- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2023 07:10 AM
I have created a custom reference field xyz and have written a on change client script to populate the xyz field value as per the existing reference field caller on the incident form.
Value of xyz field is getting populated properly as per caller field but preview is not available for the xyz field.
Can anyone please help me out.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2023 12:15 AM
you just want to set value of caller into another field then why to use getReference
directly set it like this
g_form.setValue('u_affected_user', g_form.getValue('caller_id'));
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
‎07-10-2023 08:00 AM
Hi @abhisek ,
can you share the screenshot of those fields ?
ServiceNow Community MVP 2024.
Thanks,
Pavankumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2023 10:56 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2023 11:49 PM
Hi @abhisek ,
may be this is because of the onchange client script.
Try to inactive client script and then select any record on Affected User field then is preview.
share the requirement how you are setting Affected user based on Caller or share your client script?
ServiceNow Community MVP 2024.
Thanks,
Pavankumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2023 11:57 PM
Hi Pavankumar,
Preview is available when client script is inactive and selecting affected user field value manually.
Below is my client script: