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-28-2018 09:58 AM
Thanks Harshvardhan - I couldn't find it even though I looked in the business rules.
However, the instruction to create a client script doesn't work either. Here is what I have:
Client Script:
Variable that I need to populate based on the logged in user:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2018 10:05 AM
If you want to populate loged in user department then add javascript:gs.getUser().getDepartmentID();
in your department variable.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2018 09:49 PM
any update here ?
if your query has resolved kindly mark the answer correct and close this thread.