- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2023 07:54 AM
I have an "Account" variable (reference field) to customer_account table and i have a "Site" variable (reference field) to cmn_location table. The "Site" variable sits in a MRVS. When account is selected and i click into the MRVS and select "Site" i should only see sites relating to the account.
The relationship is, there is an account field within the location table which captures the account.
I thought this would be simple with Ref qualifier and variable attributes but cannot get it to work
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2023 07:31 AM
Its sorted. Managed to populate the account field from the below script
function onLoad() {
//populates the Account_capture variable with the Account variable selected.
g_form.setValue('account_new', g_service_catalog.parent.getValue('account'));
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2023 08:00 AM
This post goes thru it
You need to set the Variable attribute ref_qual_elements to get the dependent attribute to work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2023 04:59 AM
Thanks for the response. I did try this but it did not work. Its the MRVS causing the issue. I need to populate the account_new variable in MRVS from the account variable outside the MRVS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2023 07:31 AM
Its sorted. Managed to populate the account field from the below script
function onLoad() {
//populates the Account_capture variable with the Account variable selected.
g_form.setValue('account_new', g_service_catalog.parent.getValue('account'));
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2023 11:06 AM
here is script please change it with your variable backend names
You need to create a reference variable to account table in Multi row variable set and hide it.
Create below catalog client scripts in cat item to pass account details to MVRS.
1. Pass Account(onChange applies to catalog item)
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if (typeof(Storage) !== "undefined") {
sessionStorage.setItem("account", "" + g_form.getValue('accounts'));
} else {
alert("Sorry, your browser does not support Web Storage...");
}
}
2. Get Account(onLoad applies to catalog item)
function onLoad() {
if (typeof(Storage) !== "undefined") {
sessionStorage.setItem("account", "" + g_form.getValue('accounts'));
} else {
alert("Sorry, your browser does not support Web Storage...");
}
}
3. Get Program (OnLoad on MVRS set)
function onLoad() {
var account = sessionStorage.getItem("accounts");
g_form.setValue('account', account);
}
Now with account is available in MVRS you can write simple ref qualifier and filter records.
Let me know if you need help with ref qual.
Bharath Chintala