Need to create Multiple RITM from one catalog

Nitesh Kumar5
Tera Contributor

Hi,

 

I have a requirement, where I have to create multiple request items under a single request using one catalog form.

 

We have one list collector field If the User selects multiple value from list collector then the multiple ritm should be generated.

 

Tried the below code(for checkbox type variable) and getting the multiple ritm but workflow not getting attached and unable to see variable value on ritm(except the default RITM)

var ab = current.variables.check_box;
var ab1 = current.variables.check_box1;
var ab2 = current.variables.check_box2;

var mandatory = [ab,ab1,ab22];

var num = 0;

for (var i = 0; i < mandatory.length; i++) {

if (mandatory[i] == 'true') {
num ++;
}
}

 

for(var j = 0 ; j< num ; j ++){
var gr = new GlideRecord('sc_req_item');
gr.initialize();
gr.cat_item = current.cat_item;
gr.request= current.request;
gr.insert();
}

2 REPLIES 2

Community Alums
Not applicable

@Community Alums I have already gone through the mentioned post and observed that same issue(Workflow not getting attached)