Populating the Requested For default value in Catalog Item except when the company is a specific company

Amanda37
Tera Contributor

We have our system set up with our company as an Operating company and then different client companies.

On pretty much all the catalog items we have a variable to ask the "Requested For" which has the default value of javascript: gs.getUserID();

I want to restrict the table so that the requested for does not include the operating company (which I have done on the "Type Specifications" tab.)

However when a member of the operating company logs in, although you can not pull down members from the operating company in the drop down, the requested for is still populated with the current logged in user.

Any ideas what I could enter in the default value for this to do "if company is not operating company - get user id, else leave blank"

1 ACCEPTED SOLUTION

Oops, it should have been

javascript:if( gs.getUser().getCompanyID() != "COMPANY_RECORDS_SYS_ID" ) { gs.getUserID(); }

 

View solution in original post

8 REPLIES 8

DrewW
Mega Sage
Mega Sage

You could do something like

javascript:if(gs.getCompanyID() != "COMPANY_RECORDS_SYS_ID") { gs.getUserID(); }

Amanda37
Tera Contributor

Thanks, I have just tried that - its blank for me (being the operator company) but when i impersonate a client user it is also blank.

Oops, it should have been

javascript:if( gs.getUser().getCompanyID() != "COMPANY_RECORDS_SYS_ID" ) { gs.getUserID(); }

 

Amanda37
Tera Contributor

Thanks, that still doesnt work.  I tried it the opposite way too (so changed it to equalling the system id of the company of the person i am impersonating) - and still didnt bring the person back.