A catalog item to generate one REQ with multiple RITMs

Wei_ Ling
Tera Guru

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:

Wei_Ling_0-1672025445061.png

  • Below is a abnormal RITM(No variables):

Wei_Ling_1-1672025491854.png

 

8 REPLIES 8

jaheerhattiwale
Mega Sage
Mega Sage

@Wei_ Ling You need to add all the items (3 in your case) to the cart. 

jaheerhattiwale_0-1672033778070.png

 

Then go to cart in the menu

jaheerhattiwale_1-1672033828539.png

 

Then proceed with checkout

jaheerhattiwale_2-1672033854322.png

 

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

jaheerhattiwale_3-1672034049223.png

 

Open your portal record and open main menu

jaheerhattiwale_4-1672034071636.png

Add the enable_cart in the JSON like below

jaheerhattiwale_5-1672034131731.png

 

OR

You can create order guides.

Go to below link for info

 

https://docs.servicenow.com/bundle/quebec-servicenow-platform/page/product/service-catalog-managemen...

 

Please mark as correct answer if this solves your issue.

 

 

 

Please mark the answer as correct or helpful based on impact
ServiceNow Community Rising Star, Class of 2023

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?

@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.

Please mark the answer as correct or helpful based on impact
ServiceNow Community Rising Star, Class of 2023

Hello Wei

Did you finally get any operation that worked? If yes, could you please share I have a similar requirement