Catalog Item: How to populate other reference fields on a form based on the logged in user?

gjz1
Giga Expert

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.

 

 

12 REPLIES 12

gjz1
Giga Expert

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:

find_real_file.png

 

Variable that I need to populate based on the logged in user:

find_real_file.png

 

 

 

If you want to populate loged in user department then add javascript:gs.getUser().getDepartmentID();

in your department variable.

 

 

any update here ?

if your query has resolved kindly mark the answer correct and close this thread.