Skip to content

Commit bef28e6

Browse files
authored
Update Write to Parent Form.js
1 parent 06a92f7 commit bef28e6

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed
Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
Use the g_service_catalog.parent object to interact with the parent form from within a MVRS script
1+
//These methods can be used onLoad, onChange, or onSubmit in a script that Applies to the MRVS
22

3-
//Retrieve a variable value from the parent form
3+
//Retrieve a variable value from the parent form - works in native UI as well as Service Portal, etc.
44
g_service_catalog.parent.getValue('variable_name');
55

6-
//Set a variable value on the parent form
7-
g_service_catalog.parent.setValue('variable_name');
6+
//With this approach, you can set a variable value on the parent form - use similar code for other g_form methods like clearValue
7+
//Service Portal method requires an additional Catalog Client Script onLoad that Applies to the Catalog Item
8+
if (this) { //Service Portal method
9+
this.cat_g_form.clearValue('variable_name');
10+
} else { //native UI method
11+
parent.g_form.clearValue('variable_name');
12+
}

0 commit comments

Comments
 (0)