create multiple RITM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2020 04:07 AM
How can i create multple ritm ( simple way) from workflow .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2020 04:45 AM
Hi Sneha,
From workflow run script activity you can create mulitple RITM like parent-child RITM.
I tried to create second RITM from first RITMs Worflow.
run script code:
var secure_area = 'd901fec4dbee4cd4f6e1dd30cf9619c3'; //sys_id for the 2nd catalog item(RITM)
//create a new item in the request
var reqHelper = new GlideappCalculationHelper();
reqHelper.addItemToExistingRequest(current.request, secure_area, 1); // 1 is the qty
reqHelper.rebalanceRequest(current.request);
//find the item and update itsvariables
var grReqItem = new GlideRecord('sc_req_item');
grReqItem.addQuery('request', current.request);
grReqItem.addQuery('cat_item',secure_area);
grReqItem.addQuery('parent','');
grReqItem.query();
if(grReqItem.next()) {
grReqItem.variables.company = 'Test';
grReqItem.variables.mobile = '12345';
grReqItem.parent = current.sys_id;
grReqItem.update();
}
Thanks,
Vishal Khandve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2020 05:09 AM
Hi,
I want to create two RITM from one catalog item only ( through workflow) and i want to set different location ( for RITM1 = ISM, FOR RITM2 = KRT)
how can i achieve this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2020 09:17 PM
try this one sneha. Set location variable to ISM from 1st catalog item and in the script set location to other.
var secure_area = 'd901fec4dbee4cd4f6e1dd30cf9619c3'; //sys_id for the same catalog item
//create a new item in the request
var reqHelper = new GlideappCalculationHelper();
reqHelper.addItemToExistingRequest(current.request, secure_area, 1); // 1 is the qty
reqHelper.rebalanceRequest(current.request);
//find the item and update itsvariables
var grReqItem = new GlideRecord('sc_req_item');
grReqItem.addQuery('request', current.request);
grReqItem.addQuery('cat_item',secure_area);
grReqItem.addQuery('parent','');
grReqItem.query();
if(grReqItem.next()) {
grReqItem.variables.location= 'KRT';
grReqItem.parent = current.sys_id;
grReqItem.update();
}
Thanks,
Vishal Khandve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2020 09:55 PM
Hi Sneha,
Try to replicate your code with below link code:-
Thanks,
Priyanka