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.

catalog ui policy set value

venkatanathansp
Tera Contributor

In a variable set i have four fields ItemA (reference), ItemB, ItemC and Quantity. 

my requirement is need to make quantity field read-only, when the other fields are empty and editable when other three fields are not empty.

 

Give me catalog UI policy script to achieve this requirement.

 

Thanks in Advance.

2 ACCEPTED SOLUTIONS

Runjay Patel
Giga Sage

Hi @venkatanathansp ,

 

No need to write script for this you can configure it like below. Select your ItemA,B and C.

RunjayPatel_0-1730896511684.png

RunjayPatel_1-1730896598983.png

 

And if you want script then use can do below.

RunjayPatel_2-1730896737876.png

 

Note: Do either script or action but not both.

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------

 

 

 

 

 

 

View solution in original post

Juhi Poddar
Kilo Patron
Kilo Patron

Hello @venkatanathansp 

This can be achieved just by configuring and doesn't need scripting.

Please refer the attached screenshots for your reference.

 

Screenshot1: Make quantity editable

 

JuhiPoddar_0-1730897299432.png

 

Screenshot2: Make quantity read only

JuhiPoddar_1-1730897364232.png

 

Preview of result:

JuhiPoddar_2-1730897566450.png

JuhiPoddar_3-1730897598377.png

 

"If you found my answer helpful, please give it a like and mark it as the accepted solution. It helps others find the solution more easily and supports the community!"

 

Thank You

Juhi Poddar

 

View solution in original post

2 REPLIES 2

Runjay Patel
Giga Sage

Hi @venkatanathansp ,

 

No need to write script for this you can configure it like below. Select your ItemA,B and C.

RunjayPatel_0-1730896511684.png

RunjayPatel_1-1730896598983.png

 

And if you want script then use can do below.

RunjayPatel_2-1730896737876.png

 

Note: Do either script or action but not both.

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------

 

 

 

 

 

 

Juhi Poddar
Kilo Patron
Kilo Patron

Hello @venkatanathansp 

This can be achieved just by configuring and doesn't need scripting.

Please refer the attached screenshots for your reference.

 

Screenshot1: Make quantity editable

 

JuhiPoddar_0-1730897299432.png

 

Screenshot2: Make quantity read only

JuhiPoddar_1-1730897364232.png

 

Preview of result:

JuhiPoddar_2-1730897566450.png

JuhiPoddar_3-1730897598377.png

 

"If you found my answer helpful, please give it a like and mark it as the accepted solution. It helps others find the solution more easily and supports the community!"

 

Thank You

Juhi Poddar