- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2023 12:35 PM
Hello.
When a new incident's form is shown (via the Incidents > Create New module), I'd like to obtain the following behavior:
1) when category is set to A or B (let's use letters for an easier description), clear the Service value AND set it as mandatory;
2) when category is set to C or D, clear the Service value but NOT set it as mandatory.
These point's behavior is also required when category is changed from one value to another.
In order to accomplish that, I have implemented a UI Policy with trigger "Category is A or B" and the related true and false scripts, but the observed behavior is that the Service field is cleared and set as mandatory only when category changes from A to B through one of the case 2 values, BUT NOT when category is changed from A to B directly.
Can someone please provide some advice?
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2023 12:58 AM
Hello.
Eventually I've solved the issue.
The points below describe the action I've taken.
- I inactivated the UI Policy (Active=false), as it appears not be needed any longer and
- I updated the 1st OOTB row of the onChange Client script as follows:
from if (isLoading || newValue === '' || g_form.isNewRecord())
to if (isLoading || newValue === '')
I hope that what above may help other developers.
Thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2023 06:44 AM
I'm a bit confused as to how none of my replies are Helpful here.
I'm also confused as to what you actually have implemented, in the end...
I see you've marked your own reply as Accept Solution and what you've said in it doesn't make sense. You're telling us you've inactivated a UI Policy and that you changed an out of the box onChange client script to remove the isNewRecord check.
Coming into this you were working on a UI Policy. So are you saying you are still using the same UI Policy or did you do something different?
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2023 07:03 AM
Hi Andreas.
I understand that my texts could have been confusing, let me try to clarify the whole scenario.
- Initially I developed both a UI Policy and a Client Script (onChange), to handle the Service field on both a new incident form and a saved incident one but, as said, something did not worked as I'd have liked.
- As it seemed to me that the issue were in the UI Policy (as the Client Script return in case of a new record), I didn't mention the Client Script to avoid providing too much details that might have caused the description to be unnecessarily complex.
I apologize if this have misled you. - While we were dialoguing on this question, I reviewed the whole implementation of mine so that:
3.a) I updated the Client Script (as described) and
3.b) I inactivated the UI Policy, that might consequently be (and proved to be) unnecessary. - The above attempt was successful and I shared the result here therefore, summing up:
4.a) the UI Policy I was focusing on initially was unnecessary, because the issue was solved by
4.b) updating the Client Script as described.
I hope what above provide the clarifications you need.
Thanks for your patience and kind help.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2023 07:12 AM
Hello,
Ok. Hopefully you can see where you not mentioning any client script at all and then marking your own reply with client script edits is confusing and will confuse others as the only mention of a client script prior to your own reply marked as correct was what I said.
In any case, I'm glad it's resolved. In future questions you may ask, it's hopeful you can provide as much information as you can so that we can properly assist you.
I've provided several replies, to include script and other careful mentions, and none of it seemed to help you as you were working on other things on your own that we did not know.
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2023 07:15 AM
Sure, Andreas.
Thank you again. 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2023 12:58 AM
Hello.
Eventually I've solved the issue.
The points below describe the action I've taken.
- I inactivated the UI Policy (Active=false), as it appears not be needed any longer and
- I updated the 1st OOTB row of the onChange Client script as follows:
from if (isLoading || newValue === '' || g_form.isNewRecord())
to if (isLoading || newValue === '')
I hope that what above may help other developers.
Thanks.