- 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-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-11-2023 12:31 AM
Hi Ankur,
It is working now. Thanks a lot for your help 😊
Regards,
Abhisek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2023 12:55 AM
Hi @abhisek ,
If you are trying to set same value on different field then why you need 2 different fields?
ServiceNow Community MVP 2024.
Thanks,
Pavankumar