Can we apply reference qualifier to a variable which is inside the MRVS ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2024 07:22 AM
I have two fields of the same table 1 is in the MRVS and another one is outside on the main catalog item form
the one which is inside the MRVS is depended on the one which is outside
Outside var name - Model Type number
Inside var name - Cost Codes which are associated with the model type
kindly suggest me any solutions on how do I populate cost codes based on model type?
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2024 12:32 PM
You can (currently) only use variables in the MRVS in a reference qualifier in the MRVS. A workaround I have used in this scenario is to create an additional variable in the MRVS (named model_type_mrvs in this example) that matches the type of variable as the one outside the MRVS (named model_type in this example). Then create an onLoad Catalog Client Script that applies to the MRVS. This script will populate the new variable in the MRVS with the value from the variable outside the MRVS. You can also add a line to make this read only, and/or hide this variable - or try the 'hidden' checkbox on the variable definition, but just know that either method will only hide the variable on the add/edit dialog, not when the contents of the MRVS are displayed. This is what the script would look like:
function onLoad() {
g_form.setValue('model_type_mrvs', g_service_catalog.parent.getValue('model_type');
g_form.setReadOnly('model_type_mrvs', true);
}
You can then use current.variables.model_type_mrvs in your reference qualifier.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2024 10:26 AM
This is a great solution, thanks for sharing!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2024 02:11 PM
Here's a method that does not require the creation of another MRVS variable: