Get user company field from incident company while creating through caller

krishna115
Tera Contributor

Hi Team,

 

Please provide solution for below,

 

When user click to search caller and he can’t find it, he will create new user. When creating a new user company field has default value. So, my requirement is when user try to create a new user after click on search caller that time company field value is need to fix to be company from incident, and make read only this field from changes (only through caller --> new user --> company read -only).

 

krishna115_0-1745247348360.png

 

krishna115_1-1745247367056.png

 

Thanks,

Krishna

 

4 REPLIES 4

J Siva
Tera Sage

Hi @krishna115 

As far as I know, it's not possible. The "New" button on the sys_user table is a global UI action and does not have any link or reference to the INC table or record.

Therefore, you cannot pass the company reference from an INC record to a sys_user record.

Reagrds,

Siva

Ankur Bawiskar
Tera Patron
Tera Patron

@krishna115 

It's recommended to allow creating a new user if caller is not found.

User data usually comes as part of LDAP

Please discuss with your customer about this

Even if you want to achieve this requirement it will involve lot of checks and not recommended

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

@krishna115 

this should work for you

this is the URL which it gives in onLoad client script on sys_user and it contains incident sysId

Use GlideAjax, get the incident's company and set it and make the company field as readonly

I believe reference fields are readonly when you click New button from that lookup.

If so then you cannot achieve this requirement

AnkurBawiskar_0-1745294490106.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

@krishna115 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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