This catalog client script is not VA supported due to the presence of the following variables in the

GhitaB
Tera Contributor

actually i m facing that error message '

This catalog client script is not VA supported due to the presence of the following variables in the script: g_service_catalog.parent.getValue' cause i m trying to get a value of a field that is outside the MRVS i tried multiple ways before but none of them worked , is there any alternative? cause this g_service_catalog.parent.getValue is the only solution that worked for me as i need to put some fields mandatory based on the field that is outside the modal of MRVS
 
1 ACCEPTED SOLUTION

@GhitaB 

that should be fine, you need not worry on that info message.

that's the only way which ServiceNow allows to access outside variable within MRVS.

You can use that safely.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

6 REPLIES 6

Mohammad Danis1
Giga Guru

@GhitaB ,

You can follow the below approach as well:

Create a hidden variable inside the MRVS — call it copy_of_outer_variable.

Use a Catalog Client Script (onLoad) on the main catalog item (outside MRVS):

Loop over the MRVS entries and set the hidden field to the outer variable's value.

// This runs outside MRVS
function onLoad() {
var outerVal = g_form.getValue('outer_variable');
var mrvs = g_form.getValue('multi_row_variable_set');

// You can't directly set MRVS values, so use GlideAjax or inject during row creation
}

In the MRVS client script, reference copy_of_outer_variable instead of g_service_catalog.parent.getValue().

This keeps all data within the MRVS scope and avoids the unsupported parent reference.

Regards,
Mohammad Danish

i've tried doing this but sadly didn t work