UI policy - field not mandatory

bjhughey164
Mega Expert

On the incident/incident form, I have a UI policy that runs

        If location ='s X > add additional field and make it mandatory

But, is it possible to do the reverse? I want to make something like :

        If location ='s X > make caller field (which is normally mandatory) not mandatory.

1 ACCEPTED SOLUTION

Hi Ben,



Very creative thinking. Yes, you can do this by adding an additional statement between line 17 and 18. You'll need the sys_id of the location to compare against the caller.location value.



Also be aware that this is an OOB client script and once you modify it, you own it. An alternate method would be to copy it, deactivate the original (just uncheck active and save) and then modify your copy.


View solution in original post

13 REPLIES 13

Chuck Tomasi
Tera Patron

Hi Ben,



It depends how you are setting the field to mandatory. If it is done at the dictionary level, then a UI policy isn't going to "undo" the mandatory setting. If it is set from another UI policy or client script, then yes, the last UI policy to run has control. You can use the order field on the UI policy to determine which runs first, second, etc.


Got it.



So, even though I never thought this situation would come up...is it best practice to use a UI policy for mandatory fields in most cases? Obviously, I'd have more control going forward over when to run certain items and I can always use the filter to only run when certain criteria are met where when I use the dictionary to hard code it, it's all or nothing..


Now I think I'm in a pickle.



The UI policy for mandatory fields is created. The ui policy for when location = x make caller.id not mandatory works however, when the system was implemented earlier this year, the business wanted the location field to populate a list for the caller.id field...and if the caller.id field is filled in first, then it populates the location. So, when my UI policy runs, it makes the caller.id field editable but once I tab down to the next field, it gives me a lovely pink field and erases the location...



Do I need to create yet another rule or policy to bypass this or is this the case where I need something scripted?


I've read this three times and I'm still not sure I understand the issue. Sorry. Perhaps images of what is currently happening and what you would like to happen would help.