MRVS on load Not fetching its own value from g_form

Aditya Kumar1
Tera Contributor

Hello Experts,

 

I'm stuck in a situation where i've a mrvs backend name "isp" i wrote a small on load catalog client script inside that mrvs that will fetch the value of its own at on load,

 

it has two record already but its not fetching those records i want that when i click to "add" button in mrvs 

then this on load should trigger and bring me that mrvs array 

 

 

 

 

'[{"id_isp":"ISP02139- 1","isp_component_type":"Primary"},{"id_isp":"ISP02139- 2","isp_component_type":"Secondary"}]'

 

 

 

this is the output of that mrvs i expect in alert where it has two records.
and this is the script i'm trying to fetch 

 

 

 

function onLoad() {
	
    alert('test');
    alert(g_form.getValue(JSON.parse(g_form.getValue('isp'))[0].isp_component_type));

}

 

 

AdityaKumar1_0-1699531418909.png

this is my catalog client script on mrvs 
please help me in this.

5 REPLIES 5

The value of the MRVS acts like a main record producer variable, so since you are in a MRVS you access those the same way

alert(g_service_catalog.parent.getValue('iata'));