Preview is not available for a custom reference field.

abhisek
Tera Contributor

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.

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@abhisek  

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.

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

View solution in original post

7 REPLIES 7

Pavankumar_1
Mega Patron

Hi @abhisek  ,

can you share the screenshot of those fields ?

If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar

abhisek
Tera Contributor

Screenshot 2023-07-11 112437.pngScreenshot 2023-07-11 112504.png

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?

 

If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar

Hi Pavankumar,

Preview is available when client script is inactive and selecting affected user field value manually.

Below is my client script:Screenshot 2023-07-11 122505.png