UI Policy with setValue not setting the correct value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2024 06:56 AM
I've got the following UI policy for a catalogue item that is used to update the value of a certain field when the conditions are met:
The script of the UI Policy is:
However, what I'm finding is that if I go onto my catalogue item and trigger the UI Policy, it's not setting the to field to Not Applicable, but Read Only:
So I was just wondering if anyone knows why the text specified in SetValue is not working as it should?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2024 07:02 AM
Hi @matthew_hughes ,
Check the order of the UI Policy and also check the Reverse if false check box for other UI policies.
Why not do this scripting in client script instead of ui policy?
Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks & Regards,
Sumanth Meda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2024 12:27 AM
Hi @Sumanth16
Hi @Community Alums
I've now made two UI Policies:
Whilst it does make the field Read only when it correctly should, it's not adding the value of 'Not Applicable'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2024 07:06 AM
Hi @matthew_hughes ,
It's because, you are using 2 things at the same time, which is a script and "Catalog UI policy actions" simultaneously.
You need to understand :
Execute if true [Advanced view] | A script that executes when the conditions of the UI policy are fulfilled.
|
Execute if false [Advanced view] | A script that executes if the conditions of the UI policy are not fulfilled and the Reverse if false option is selected.
|
Now, if you are using the above scripts, and it fulfils your requirement, then don't use "Catalog UI policy actions", make it active false.
As per you screenshot, the Catalog UI policy actions is working not the script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2024 12:27 AM
Hi @Community Alums
I've now made two UI Policies:
Whilst it does make the field Read only when it correctly should, it's not adding the value of 'Not Applicable'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2024 09:17 PM
Hi @matthew_hughes ,
Please read through this doc : https://docs.servicenow.com/bundle/washingtondc-servicenow-platform/page/product/service-catalog-man...