The CreatorCon Call for Content is officially open! Get started here.

How to Limit a Reference Variable in an MRV for the same value selected in the first Row

Peter Williams
Kilo Sage

good morning everyone,

so i have a trick request to configure,

i have an MRV with a reference variables that is looking up on the cmn_department table

 

i want to have the ability to auto fill the other row users will select with the same value they selected in the first row of the MRV.

 

Example:

 

the Department Column u selected Office Expenses

 

PeterWilliams_0-1712240365919.png

 

i want every other row to only show Office Expenses and not have the users be able to select anything else but Office Expenses base on their first row

so all other rows will only have the Office Expense and nothing else

 

is this possible with an onChange script?

 

1 ACCEPTED SOLUTION

maroon_byte
Mega Sage

Consider having Department variable outside of your mrvs in the form as well.. After the user selects this form Department variable and is adding first mrvs row, use onLoad script within mrvs to set the read-only mrvs Department field using below script:

 

var dept = g_service_catalog.parent.getValue('department');
    g_form.setValue('mrvs_dept', dept);

View solution in original post

21 REPLIES 21

maroon_byte
Mega Sage

Consider having Department variable outside of your mrvs in the form as well.. After the user selects this form Department variable and is adding first mrvs row, use onLoad script within mrvs to set the read-only mrvs Department field using below script:

 

var dept = g_service_catalog.parent.getValue('department');
    g_form.setValue('mrvs_dept', dept);

Thank you, thank you and Thank you, this is excately what i needed

i can now use this for other forms