Refereance field value set
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2025 05:55 PM
Hi All,
i am facing a strange issue .on incident form we have a site contact field which is of type reference .when user select site contact value as other, on change client script open up a dialogue window built using ui page .user need to fill details and click on add button which create a contact record and set the value to site contact record. Value is getting set but when I click anywhere on the form again it reverted back to previous value and ui page got open. Any one has faced similar issue .please let me know. Please let me know how troubleshoot this kind of issue and how to find code or script revert the value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2025 06:47 PM
it's platform behavior.
UI page got opened when value changed and again if user clicks somewhere in the form it will trigger onChange client script
You should check in client script if oldValue!=newValue
please share your script
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2025 06:52 PM
seems when you set the value from UI page the onchange is getting triggered.
I will suggest to set the value via UI page processing script i.e. in backend via GlideRecord so that it doesn't impact the onChange client script
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2025 07:20 PM
@Ankur requirement is to keep this new record only
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2025 07:50 PM
so this is for new record and not for existing one?
So you cannot GlideRecord in UI page as record doesn't exist.
What's the business requirement to show UI page?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader