How to auto-populate the user Company and Cost center code in the "x" variable of catalog item.

Kruthika BM
Tera Contributor

Hi All,

 

I want to auto-populate the Company and Cost center code of the "requested for" user without writing client script/ UI policies. I want update on the variable level. I tried by providing the default value as "javascript:gs.getUser().getCompanyID();". But, I'm just getting the SysID of the Company. Tried by giving alternative value as well, like CompanyName.. but not working

Can anybody please help me to get the correct value of the Company and cost center code together. As I don't have idea, which backend value to be provided under "Default"

Example., Netherland - NL

 

Thanks in Advance!

 

Regards,

Kruthika 

 

5 REPLIES 5

Thankyou for the solution Deepak Shaerma.

The above Code is working to display the Company Name of the Requested For User. By just copy pasting it in the Default Value Field of the Variable.