How to display locations based on company in catalog

nagaklv
Tera Contributor

Hello Community,

I have two variables in catalog item 

1. Vendor - reference to core_company

2.locations - reference to cmn_location

So if i select company and it should be related locations in location reference

for example if select japan and it should be display only japan locations in locations reference variables

 

Can you please help me how to sort out this.

 

Thanks,

Nagesh klv

1 ACCEPTED SOLUTION

Hi,

You also need to add the following attribute

ref_qual_elements=vendor

Only then the selected vendor will be passed to the server and fetches the locations accordingly.

View solution in original post

11 REPLIES 11

Siddhnath Pande
Mega Guru

Hi,

If I am not wrong. the question must be like this based on the location field vendor should auto populate or vice-versa.  Well here the dependent field concept comes.

In the dictionary, you can specify a dependent field in the User or Location field, which displays the appropriate territory in the selector choice list when a user enters a phone number.

In the dictionary, you can specify a dependent field in the User or Location field, which displays the appropriate territory in the selector choice list when a user enters a phone number. For example, if you enter caller_id in the dependent field in the Incident table, the appropriate territory is added to the territory selector choice list when a user enters caller information.

Read this below link this might help.

https://docs.servicenow.com/bundle/orlando-platform-administration/page/administer/field-administrat...

 

If the above code helps then please mark my answer Correct and Helpful.

Thanks and Regards:
Siddhnath Pandey

Arjun31
Giga Expert

hello,

 

please use advance ref qualifier on cmn_location field.

find_real_file.png

 

here you can use your field name as javascript:'company='+current.variables.vendor;

 

please mark helpful or mark correct if it works.

regards,

Arjun Shinde