Multiple RITM need to be generated based on number of options selected in the list collector variabl

suuriya
Tera Contributor

Hi Community,

 

I have a requirement, in catalog form there is list collector variable if i select 3 options then 3 ritms needs to be created under the request.

 

How can we achieve this

 

Thanks in advance

 

5 REPLIES 5

Anirudh Pathak
Mega Sage

HI @Anirudh Pathak ,

 

Thanks for this article but can you let me know how we can achieve this using CartApi....im looking for this

SunilKumar_P
Giga Sage

Hi @suuriya, You can try with the 'GlideappCalculationHelper'. If you are using the workflow, you need to write the script in run script activity or if you are using the flow designer, then you may need the script action where you need to write the script.

 

var catItemId = "<catalogItemSysId>";
var requestId = current.request;
var listCollector = current.variables.<your_list_collector_name>.toString().split(',');
for (var i = 0; i < listCollector.length; i++){
var helper = new GlideappCalculationHelper();
helper.addItemToExistingRequest(requestId, catItemId, "1");
}

 

Regards,

Sunil