onLoad MRVS client script - task unique ID and/or g_scratchpad

kchorny
Tera Guru

I need to get a field value from the parent sc_task in a MRVS onLoad client script...

I tried using g_scratchpad but the script fails when trying to get the value, indicating to me that g_scratchpad is not available to variable set client scripts...? (I'm using the same g_scratchpad successfully at the sc_task form level.)

Therefore, I need to call an ajax script include to get the sc_task field value that I need, but when I load a row in the MRVS, g_form.getUniqueValue gives me the MRVS unique ID. Therefore, apparently my script include is going to need to use the MRVS unique ID to get a value from the sc_task record. How do I get the task sys_id using the MRVS sys_id? I'm stumped as to which table I would grab that from.

1 ACCEPTED SOLUTION

Mohith Devatte
Tera Sage
Tera Sage

Hey There ,

This is bit weird limitation which we have in MVRS .There is a work around for it .

Follow below steps

Create a Catalog Client Script related to the Catalog Item with this content (onLoad):

//save rows from MRVS into some global variable
GLOBAL_VAR = {g_form: g_form}

 

2. Create another Catalog Client Script related to a variable set i mean inside the variable set  which takes the data from the global variable (onChange):

//take the rows from global variable
var data = GLOBAL_VAR.g_form.getValue("your field name");

//parse it!
var object = JSON.parse(data);

 

Please try this and accept the solution if it is working for you as this is a huge problem for every one useing MVRS . This answer might be helpful 

View solution in original post

1 REPLY 1

Mohith Devatte
Tera Sage
Tera Sage

Hey There ,

This is bit weird limitation which we have in MVRS .There is a work around for it .

Follow below steps

Create a Catalog Client Script related to the Catalog Item with this content (onLoad):

//save rows from MRVS into some global variable
GLOBAL_VAR = {g_form: g_form}

 

2. Create another Catalog Client Script related to a variable set i mean inside the variable set  which takes the data from the global variable (onChange):

//take the rows from global variable
var data = GLOBAL_VAR.g_form.getValue("your field name");

//parse it!
var object = JSON.parse(data);

 

Please try this and accept the solution if it is working for you as this is a huge problem for every one useing MVRS . This answer might be helpful