Need to populate location field based on the country selection
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2018 07:04 PM
Hi all,
I have a requirement where in we need to populate the location (reference to cmn_location) value based on the selection of country (reference to core_country). If for example countries Japan and China are selected then on the locations that are active under these countries should be available for selection in location field.
I got to know that we need to achieve this through script include and advance reference qualifier since the location field is a reference field.
Could you please help me with the script, Im fairly new to scripting and would be a great learning for me.
Thanks in advance.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2018 08:39 PM
Hello,
Can you try this out? On the advanced reference qualifier of Location field add this script.
javascript: country=current.u_country.getDisplayValue(); //u_country is the name of your country reference field
Also make sure the country name is same as that in Location table
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2018 09:28 PM
Hi,
I have updated the advanced reference qualifier on the location field but still it is not working. It showing all the locations from all the countries.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2018 09:30 PM
I missed to add quotes, Please change this line to
javascript: 'country='+current.u_country.getDisplayValue();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2018 09:35 PM
I have tried the above script in the advance qualifier of the location field now it is showing empty in the location field even if I select country. Please suggest.