gs.getUser().getCompanyID(); gives underdefined output on Incident table after WC upgrade

soumyadaggula
Tera Contributor

Hi Team , 

We have upgraded our instance to WC , and we noticed that Company field on Incident form auto populating as undefined , in default value this is the code 
" javascript: if(current.sys_class_name=='problem')gs.getUser().getCompanyID(); "

soumyadaggula_0-1726225104282.png

what could be the issue here ?

 

5 REPLIES 5

Sanjay191
Tera Sage

Hello @soumyadaggula 
If you are apply on the incident then its sys_class_name would be incident so according to your condition it will give undefine because it fall into the else condition so in else condition there is no value it give undefine i guess.

Rajesh Chopade1
Mega Sage

Hi @soumyadaggula 

 

Try once by replacing from :

" javascript: if(current.sys_class_name=='problem')gs.getUser().getCompanyID(); "

TO

" javascript: if(current.sys_class_name=='incident')gs.getUser().getCompanyID(); "

 

I hope my answer helps you to resolve your issue, if yes please mark my answer helpful & correct. 

thank you

rajesh

Sandeep Rajput
Tera Patron
Tera Patron

@soumyadaggula According to the documentation it is still a valid method in Washington release. Looks like your reference qualifier is incorrect as it only checks for one table.

Screenshot 2024-09-13 at 5.44.15 PM.png

@soumyadaggula Please mark the response an accepted solution if it addressed your question.