- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2018 05:23 AM
We are looking for a way to populate the DisplayValue of a reference field into a string field on the form based on what is selected on another field. Example...On Incident form, populate a custom Department field (u_department / string type) with the Departement of the Caller (caller-id / reference type).
In my personal instance, I have setup a GlideAjax call with a Client Script / Script Include. I am able to being over the value, but it is appearing as the sys_id. To troubleshoot, I added another custom field of Department Reference (u_department_reference / Reference type on cmn_department table). The desired value is displaying in the reference type field.
While the custom reference field type is a viable solution in this example, we have other requirements where we may like to have a reference field value populate a string field.
Is there a way to do this? Below are screenshots of the Client Script, Script Include, and the results on the Incident form.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2018 05:32 AM
Hello,
make the below changes in your script include:
instead of user_detail.department write user_detail.department.name
HOPE THIS HELPS!!!! MARK CORRECT OR HELPFUL.
Regards,
Mohammed Iqbal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2018 05:32 AM
Hello,
make the below changes in your script include:
instead of user_detail.department write user_detail.department.name
HOPE THIS HELPS!!!! MARK CORRECT OR HELPFUL.
Regards,
Mohammed Iqbal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2018 05:38 AM
Thank you for the quick response, and extra thanks for the correct answer. That simple change gave me exactly what I needed.
Brilliant!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2018 05:45 AM
Though, you found the answer, but to get the department value of the caller on incident form, you do not need a scripting. You can add the department field with dot walking.
Right click on the header -> Configure -> Form Layout and then select the caller
if you want department field as string a field then again expand the department field and use the name field,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2018 06:03 AM
welcome