A catalog item to generate one REQ with multiple RITMs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-25-2022 07:32 PM
Now I have a maintain item, and when I click Submit, a REQ request and a RITM request item will be generated. Now the customer needs to generate three request items in one request, how should I do it?
I tried to manually generate two more request items using business rule, but neither my variable nor workflow ran two request items.
Below is a normal RITM:
- Below is a abnormal RITM(No variables):
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-25-2022 09:56 PM - edited 12-25-2022 09:59 PM
@Wei_ Ling You need to add all the items (3 in your case) to the cart.
Then go to cart in the menu
Then proceed with checkout
This will create one request and add multiple (3 in your case) RITMs to the request.
To enable cart in portal
Go to "Service Portal > Portals" menu
Open your portal record and open main menu
Add the enable_cart in the JSON like below
OR
You can create order guides.
Go to below link for info
Please mark as correct answer if this solves your issue.
ServiceNow Community Rising Star, Class of 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-25-2022 10:09 PM
Thank you for your answer, but I need to automatically generate three RITMs, rather than the user to operate this form, is there any way for automatic completion?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-25-2022 10:20 PM
@Wei_ Ling Ok. Then create a after insert business rule on RITM
Add the below condition
Item is <YOUR ITEM NAME>
Script:
(function executeRule(current, previous /*null when async*/ ) {
var ritem = new GlideAggregate("sc_req_item");
ritem.addQuery("request="+current.request.toString());
ritem.addAggregate("COUNT");
ritem.query();
if(ritem.next()){
if(ritem.getAggregate("COUNT") < 3){
current.insert();
}
}
})(current, previous);
Please mark as correct answer if this solves your issue.
ServiceNow Community Rising Star, Class of 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2023 10:40 PM
Hello Wei
Did you finally get any operation that worked? If yes, could you please share I have a similar requirement