In order guide, I'm unable to fetch the values from MRVS to outside of the MRVS.

teja17
Tera Contributor

I'm having trouble retrieving values from an MRVS to use them outside of it. I want to set the values inside the MRVS and then display the variables that are outside of it based on the rows inserted into the MRVS.

4 REPLIES 4

Kieran Anson
Kilo Patron

Hi,

What have you tried so far? Do you have an existing script you've written that we can review?

function onSubmit() {
   

    d1 = g_form.getValue('device_model_devices');
    p1 = g_form.getValue('price_devices');
    var spThis = this;

    
    if (this) {
        var d1 = g_form.getValue('device_model_devices');
        var p1 = g_form.getValue('price_devices');
        var catItem = spThis.angular.element(spThis.$('#sc_cat_item_guide').find('sp-variable-layout')[0]).scope();
        var parent_g_form = catItem.getGlideForm();

        parent_g_form.setValue('device_model', d1);
        parent_g_form.setValue('price', p1);

    }

}

Thanks for script, can you provide some context to what you are trying to achieve, which field is the MRVS and which is the target?

 

Assumption is that this script is running on the catalog item, not on the MRVS?

Hi Kieran,

 

Script is running on the MRVS. 

teja17_0-1717482396865.png

From the above MRVS, I need to fetch the devicemodel and price and this MRVS is in order guide.