Refereance field value set

Ketan Pandey
Tera Expert

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

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@Ketan Pandey 

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.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Ankur Bawiskar
Tera Patron
Tera Patron

@Ketan Pandey 

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.

 

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur requirement is to keep this new record only 

@Ketan Pandey 

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?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader