field.changed not working for SOW in UI policy
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2024 12:08 AM
I have a requirement, if change coordinator and manager are same , throw and error msg to specific changed field and clear the field.
to do low code, i have written only one UI policy and set condition if "coordinator is same as manager" and running script below:
var coordinator = g_form.getControl('u_change_co_ordinator1');
var manager = g_form.getControl('requested_by');
if ( coordinator.changed && g_form.getValue('u_change_co_ordinator1')!="") {
g_form.setValue("u_change_co_ordinator1", "");
g_form.showFieldMsg('u_change_co_ordinator1', "Approving manager and change coordinator must be different", "error");
} else if (manager.changed && g_form.getValue('requested_by')!="") {
g_form.setValue("requested_by", "");
g_form.showFieldMsg('requested_by', "Approving manager and change coordinator must be different", "error");
}
this is running fine in default view but not running on SOW view.
If I remove manager.changed or coordinator.changed, it running but thats not fulfilling the requirement.
Any suggestion.
Quick response will be appreciated.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2024 01:51 AM
Hi,
Please have a look at this article -
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0855260