Catalog Item: How to populate other reference fields on a form based on the logged in user?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2018 12:08 PM
On my catalog form I have a requirement to populate the logged in user's department and location.
I have three variables on the form - requested_by, department, location - and all three are reference fields on the catalog form and on the sys_user table (department references cmn_department, location references cmn_location). I get the requested_by to display without a problem but I don't seem to be able to populate the requested_by's department and location from the sys_user table in the other fields. Any idea how I can do this in a catalog item form? I can find a lot of information for other forms but nothing specific to a catalog item.
Thanks in advance for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2018 12:13 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2018 12:14 PM
You can write Onload client script
var userdet= g_form.getReference('requested_by',getfields);
function getfields(userdet)
{
g_form.setValue('department',fac.department);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2018 12:19 PM
This is on an order guide, I don't see any option to create a script of any kind.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2018 12:21 PM
You may need to right click and choose configured > Related lists and then add Catalog client Script -> Catalog item if you do not see it on the form.