Skip to content

Commit 9ba3553

Browse files
authored
Create onLoad mrvs
Catalog Client Script to run onLoad of the MRVS, not the Catalog Item
1 parent 065c442 commit 9ba3553

File tree

1 file changed

+17
-0
lines changed
  • Client-Side Components/Catalog Client Script/MRVS dependent ref qual 1st row

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
function onLoad() {
2+
//applies to MRVS, not Catalog Item. This will pass the first selected account (if there is one) to a Script Include each time a MRVS row is added or edited
3+
var mrvs = g_service_catalog.parent.getValue('my_mrvs'); //MRVS internal name
4+
var acct = '';
5+
if (mrvs.length > 2) { //MRVS is not empty
6+
var obj = JSON.parse(mrvs);
7+
acct = obj[0].account_mrvs;
8+
}
9+
var ga = new GlideAjax('AccountUtils');
10+
ga.addParam('sysparm_name', 'setSessionData');
11+
ga.addParam('sysparm_account', acct);
12+
ga.getXMLAnswer(getResponse);
13+
}
14+
15+
function getResponse(response) {
16+
//do nothing
17+
}

0 commit comments

Comments
 (0)