The CreatorCon Call for Content is officially open! Get started 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.getUser().getCompanyID()


Thanks again Rajesh but still no luck - I think I may need to start debugging??


Hi Rajesh,


apologies but your suggestion did actually work ok - it was a group restriction on the ACL that affected my test users.


Many thanks for your help and I will mark this as the correct answer.


jadona
Giga Contributor

javascript:gs.getUser().getCompanyID()



works in demo instances.


So, your problem could be regarding permissions to read the data.


Have a look to the ACLs in the [core_company] table or other possible restrictions in the variable, catalog item, etc. such as scripts changing the value of the variable


Thanks Javier - it looks to be an ACL or Business Rule issue - I'm looking into that now