Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Catalog item variable not evaluating 'javascript: gs.getUser().getCompany()'

kc99
Giga Expert


Hi,

I wonder if anyone can help with this problem.

We have a catalog item that includes a variable set which displays a 'requestor name' and the related 'requestors company'.

The 'requestor name' is evaluated correctly and displays on the item form with a default value of 'javascript: gs.getUserID()'.

However, the 'requestors company' is not evaluated using 'javascript: gs.getUser().getCompany()' when the form loads - this script uses the syntax recommended in several posts on the community.

company_variable.png

Does anyone know why this could be - is it the ordering of the variables on the form?

I can spend some time on creating another client script to populate this field but I wanted to check why this is not working,

many thanks,

Keiron.

1 ACCEPTED SOLUTION

rajesh73_k
Kilo Expert

try this:



javascript:gs.getUser().getCompanyID()


View solution in original post

14 REPLIES 14

rajesh73_k
Kilo Expert

Try this:


'javascript: gs.getUserID().getCompany()'


Thanks Rajesh,


unfortunately this didn't work,


thanks,


Keiron.


Kalaiarasan Pus
Giga Sage

Try this



javascript:'sys_id='+(gs.getUser()).getCompanyID();


Hi,


unfortunately this didn't work either.


I hope this isn't something to do with permissions,


thanks,


Keiron.