Based on selecting 'location type' as country, state should autopopulate is another field in mrvs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2024 08:13 AM
Hi All,
To add a new location in cmn_location table, I have a mrvs where when user selects a location type say Region or country, then State should present in below parent field.
Similarly when user selects City in location type, parent field should populate sites.
How to achieve this requirement ?
Refer Below attached snips for better understanding.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2024 08:46 AM
What is the variable type of 'parent'? If it is a single row text and you mean this variable should literally be populated with either 'State' or 'sites', you can use an onChange Catalog Client Script within the MRVS:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if (newValue == 'Region') {
g_form.setValue('parent', 'State');
}
if (newValue == 'country') {
g_form.setValue('parent', 'sites');
}
}
Use your variable name for the 'parent' variable, and values, not labels for the location type.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2024 08:57 AM
Parent is a reference field which will populate values acc to selected location type.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2024 09:17 AM
If the parent variable is a reference to the cmn_location table, then instead of the onChange script the reference qualifier will be something like:
Using your variable name for the location type MRVS variable. The choice values for the location type MRVS variable must match those of the cmn_location_type field, so if you're not using a lookup select box type variable, or a choice list, make sure they are 'region' and 'country'.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2024 10:28 AM
Hi,
I tried this way but it is giving me parent as countries (in reference) when i am giving location type variable name as country.
I want Parent as states on selecting location type as country. Please correct me if i misunderstood something here.