UI Policy with setValue not setting the correct value

matthew_hughes
Kilo Sage

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:

 

matthew_hughes_0-1707835977829.png

 

The script of the UI Policy is:

matthew_hughes_1-1707836042535.png

 

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:

 

matthew_hughes_2-1707836126198.png

So I was just wondering if anyone knows why the text specified in SetValue is not working as it should?

 

 

 

11 REPLIES 11

Sumanth16
Kilo Patron

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

 

Hi @Sumanth16 

 

Hi @Community Alums 

 

I've now made two UI Policies:

 

matthew_hughes_0-1707899154976.png

 

matthew_hughes_1-1707899193823.png

 

Whilst it does make the field Read only when it correctly should, it's not adding the value of 'Not Applicable'

 

 

Community Alums
Not applicable

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.
  • This field is available only if Run scripts is selected.
  • This feature is not available outside the scope or in global scope.
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.
  • This field is available only if Run scripts is selected.
  • This feature is not available outside the scope or in global scope.

 

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.

 

Hi @Community Alums 

 

I've now made two UI Policies:

 

matthew_hughes_0-1707899154976.png

 

matthew_hughes_1-1707899193823.png

 

Whilst it does make the field Read only when it correctly should, it's not adding the value of 'Not Applicable'

 

 

Community Alums
Not applicable