how to make fields dependent using script include

Dileep Kumar3
Kilo Contributor

Hi all

I need some help

I have a custom table with two reference fields ,one COMPANY field reffering to 'corecompany' table and the other field 

USER reffering to 'sys_user' table. If i select a company name in COMPANY field ,then the users  only assosiated with that company name should be displayed . How can i do this using script include  please help.

 

 

Thanks in Advance.

1 ACCEPTED SOLUTION

The SN Nerd
Giga Sage
Giga Sage

If you can you should try using field dependency as phuong has suggested.

If this fails (sometimes reference dependencies don't work) use a reference qualifier on the User field:

javascript:'company=' + current.company

ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

View solution in original post

4 REPLIES 4

Phuong Nguyen
Kilo Guru

Hi Dileep,

Could you elaborate on why you need to do this using a script include? You could just use the "Depending" field in the "Depending Field" tab of the dictionary entry to achieve the desire result.

Regards,

Phuong

If you find my suggestions helpful, please mark it as correct or helpful to help out others as well 🙂 

The SN Nerd
Giga Sage
Giga Sage

If you can you should try using field dependency as phuong has suggested.

If this fails (sometimes reference dependencies don't work) use a reference qualifier on the User field:

javascript:'company=' + current.company

ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

 

Thankyou  Paul Morris

Working fine.

Great!

Please mark as correct if your problem is solved 🙂


ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022