- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2020 09:03 AM
Catalog Item name : TestItem.
Table : customvalue( Column name : choice field "Cater" (choices: new,old)
I want to trigger TestItem when user insert choice "new" on field "cater"
Thanks
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2020 09:17 AM
Hi,
You would want to create an after insert business rule on the customvalue table for "insert" when the choice for "Cater" field is "New". This can trigger the Cart API, which you'd script in the "advanced" section of this business rule, and you'd use that to order the catalog item: TestItem.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2020 09:17 AM
Hi,
You would want to create an after insert business rule on the customvalue table for "insert" when the choice for "Cater" field is "New". This can trigger the Cart API, which you'd script in the "advanced" section of this business rule, and you'd use that to order the catalog item: TestItem.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2020 05:33 AM
Hello,
It appears you're only responding to certain individuals, so I'll just mention one last time, that I've given instructions above...as well as a link to an example to do what you're asking.
Thanks
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2020 09:19 AM
Hello,
This is the code you can use for creating ritm on insert or update of record.
var itemGr = new GlideRecord("sc_req_item");
itemGr.initialize();
itemGr.cat_item = 'sys_id of catalog item';
itemGr.request = 'sys_id of parent request';
itemGr.state = 1;
var reqItem = itemGr.insert();
var optionGr = new GlideRecord('sc_item_option');
optionGr.initialize();
optionGr.item_option_new = 'sys_id of catalog item variable';
optionGr.value = 'variable value';
var itemID = optionGr.insert();
var relGr = new GlideRecord('sc_item_option_mtom');
relGr.initialize();
relGr.request_item = reqItem;
relGr.sc_item_option = itemID;
relGr.insert();
var startWF = new GlideRecord('sc_req_item');
if(startWF.get(reqItem)){
startWF.setForceUpdate(true);
startWF.update();
}
Mark my ANSWER as CORRECT and HELPFUL if it helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2020 03:13 AM
I have to trigger the catalog through BR, once that is triggered it will trigger the wf which will create the RITM.
SO please help me with the BR code to trigger the Catalog item.