Populate a reference field in user table

Saurabh8
Kilo Expert

Hi Team,

Below is the BR which I have written to create users in the "sys_user" table but am stuck in one place where I need to populate a reference field. ( Company Field )

What should be the exact line of code? ( The company name exists in the table but while I am trying to do a dot walk to get this value but it is note getting populated )

 

find_real_file.png

 

find_real_file.png

Thanks and Regards,

Saurabh Chatterjee

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

just update line as this

gr.u_callercompany = 'sysId'; // give sysId here directly

Regards
Ankur

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

View solution in original post

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

just update line as this

gr.u_callercompany = 'sysId'; // give sysId here directly

Regards
Ankur

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

Thank you Ankur!

Aman Kumar S
Kilo Patron

Either use setValue("your_sys_id");

if you want to use setDisplayValue("your_company_name")

Best Regards
Aman Kumar

Thank you Aman!