On Load client script is not working to make checkbox true if another date field is not empty.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2024 12:02 AM
Hi All,
I am new to ServiceNow and facing an issue, I have written an on load client script to make checkbox true if other date field is not empty.
As per my understanding my code is correct but is is not executing.
ON Load Script -
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2024 05:18 AM
@Jitendra Diwak1 thanks, it worked.😊
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2024 10:41 PM
By using UI Policy it is only working in frontend as I checked in XML it is not updating please see attached screenshot.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2024 11:31 PM
Hi @abhaysingh98,
could you please check in another instance if the issue persist?
Please accept my solution if it resolves your issue and thumps up
Thanks
Jitendra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2024 11:38 PM
@Jitendra Diwak1 , Yes I have checked in other instance also the issue is there because UI policy only change data in frontend it will not save data in database.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2024 11:50 PM
Hi @abhaysingh98,
Yes, I agree with it but UI Policy works on front end and then you have to save the form. Suppose you have assignment group and assigned to field on Incident table if assignment group is not empty then assigned to field should be mandatory. At that time you will have to fill data and you try to see the xml then data will be not there.
Please accept my solution if it resolves your issue and thumps up
Thanks
Jitendra