Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Caused by Change and Change Request field must not be the same Change Request number in incident

Arun33
Tera Expert

Hi All,

 

I want to restrict Caused by Change and Change Request field should not have same change number.

 

can you please help me on this.

 

Thanks.

Arun Pratap

1 ACCEPTED SOLUTION

RaghavSh
Mega Patron

You can restrict this by 2 On change client scripts on caused by change and change request field.

 

1. On change of "caused by change" field

if(newValue==g_form.getvalue('change_request'))

{

alert("alert msg");

g_form.ClearValue('caused_by_change');   // check backend value of caused by change

}

 

2. On change of "change request" field

if(newValue==g_form.getvalue('caused_by_change')) // check backend value of caused by change

{

alert("alert msg");

g_form.ClearValue('change_request');   

}

 

 


Raghav
MVP 2023
LinkedIn

View solution in original post

2 REPLIES 2

Gunjan Kiratkar
Kilo Patron
Kilo Patron

Hi @Arun33 ,

You can create UI policy as below

GunjanKiratkar_1-1669017236373.png

 

 

UI policy action:--

tick clear the field value

GunjanKiratkar_0-1669017178761.png

 


Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy

RaghavSh
Mega Patron

You can restrict this by 2 On change client scripts on caused by change and change request field.

 

1. On change of "caused by change" field

if(newValue==g_form.getvalue('change_request'))

{

alert("alert msg");

g_form.ClearValue('caused_by_change');   // check backend value of caused by change

}

 

2. On change of "change request" field

if(newValue==g_form.getvalue('caused_by_change')) // check backend value of caused by change

{

alert("alert msg");

g_form.ClearValue('change_request');   

}

 

 


Raghav
MVP 2023
LinkedIn