Notification Email Script getCompanyID return null

Pratap Dalai
Kilo Explorer

Hi All,

I have built notification email script

    var GU_obj=gs.getUser();  
    var compid=GU_obj.getCompanyID();
    template.print(compid);

I have tested this on "Scripts - BackGround",It returned the value as well. 

I have called the script from email Notification body,When user received the email ,They received the value as null.

thnx.

19 REPLIES 19

Chandu Telu
Tera Guru
Tera Guru

Hi Pratap,

Can you confirm user have Company ID or Company Name and Are you using global or scoped applications

 

Thanks
Chandu Telu
Please Mark Correct/helpful, if applicable,

I have tested with my user  and with two user profile ,all they have company set on their sys_user form. It not a data issue

Abhijit4
Mega Sage

Hi Pratap,

How are you triggering this notifications? 

Thanks and Regards,
Abhijit
Community Rising Star 2022

By marking my response as correct or helpful, you contribute to helping future readers with similar issues.
Regards,
Abhijit
ServiceNow MVP

I have configured notification and using ${mail_script}

I have ${mail_script:Incident_Update_N}

I have built notification script with  name "Incident_Update_N"

Did you check my above comment?

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader