- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2023 05:54 PM - edited 07-25-2023 06:01 PM
Hi!
We have a requirement where we need to set the Priority to field to --None-- (this is from the Dropdown with None) when a case form is newly created and HR Service = "HRServ1" (sample only)
I achieved this using UI Policy but the problem is, when we changed the Priority value to other options then click Save or Update button, it goes back to Priority value "--None--"
Thanks in advance
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2023 07:39 PM
Hi UI Policy will not work for this since it will run on each onload, you can go for before insert Business rule and set priority to none as this BR will run only once that is during case creation.
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2023 06:15 PM
@Tony Chatfield1 thanks. I am also trying to use this Client Script
Not working. Can you please help check if I am missing something?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2023 06:34 PM
Hi, unfortunately it is not possible to test a screenshot, but I can test the basic principle behind your code in a PDI using incident.impact and it works as expected field is set to -- None -- on load and is not reset to this value once the form is saved and reloads.
function onLoad() {
if (g_form.isNewRecord()) {
g_form.setValue('impact', '', '-- None --');
}
}
I can see in your screenshot the script is Active = false, perhaps this is the issue?
Or possibly you have other functionality impacting the record
- you previously mentioned a UI policy solution, is this disabled?
Is there any other OOB code in HR that could be impacting the result?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2023 07:12 PM
Tried to investigate but I don't see any configurations that might be affecting this.
When I tried this below script it doesn't change the onload value of Priority field.
function onLoad() {
if (g_form.isNewRecord()) {
if (g_form.getValue('hr_service') == '4889bf131b8f6b00461376e1dd4bcb43') {
g_form.setValue('priority, '', '-- None --');
}
}
}
But when I tried this, it sets the Priority field to --None--, but it goes back after saving. 😞
if (g_form.getValue('hr_service') == '4889bf131b8f6b00461376e1dd4bcb43') {
g_form.setValue('priority', '', '-- None --');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2023 07:39 PM
Hi UI Policy will not work for this since it will run on each onload, you can go for before insert Business rule and set priority to none as this BR will run only once that is during case creation.
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2023 08:22 PM
@Harish KM thanks! I believe there's something interfering this configuration I 'll have to check.