The CreatorCon Call for Content is officially open! Get started here.

Send user to RITM instead of REQ when submitting Catalog Item without Checkout Widget

Matthew Pascare
Tera Contributor

We want our service portal requests to be very simple for our users, so that when they request a service from the portal, it redirects to the RITM (since we only have 1 ritm per req), and we don't want the two-step checkout (popup after hitting order now for extra info+checkout button)

We're using the widget-sc-cat-item-v2 in our service catalog, and I found this very helpful post here, https://community.servicenow.com/community?id=community_question&sys_id=6dea38f2db42bb405d782183ca961933.

This almost fits our needs 100% perfectly, except that we don't want the two-step checkout, and turning glide.sc.sp.twostep to false skips the steps needed in the previously mentioned post from working.

Can anyone help with how we should set this up, so when submitting catalog item request, you're redirected to the RITM, without glide.sc.sp.twostep?  Or is there a better/different way to bypass the two-step checkout and make it so when you order a request it doesn't have that popup and redirects to RITM?

Thanks!

4 REPLIES 4

Harish KM
Kilo Patron
Kilo Patron

The below link will help you check it

https://community.servicenow.com/community?id=community_question&sys_id=6dea38f2db42bb405d782183ca961933&view_source=searchResult

Regards
Harish

SanjivMeher
Kilo Patron
Kilo Patron

If you deactivate the two step checkout, that should be it.

You would need the request page, because if the user uses Add to Cart, then you will need to see the request view instead of RITM view.


Please mark this response as correct or helpful if it assisted you with your question.

Hi Sanjiv,

Our users do not use "add to cart", our REQ only have one RITM, most are for the purpose of requesting a service from a team (like "reset password", "provision VM", etc).

The previously linked post works perfectly, where if there's only 1 RITM per REQ, it redirects to RITM.

The issue is disabling two step checkout seems to break it.  Works perfect with two step checkout, but we would prefer not to annoy our requester with a second pop-up box after trying to submit the request.

Can you move this code in the server code to just after 'var CartJS;' and try

 

//This is where we determine if there is one RITM associated and return something in data.ritmId if so for the client controller
		if(input && input.requestId){
			//Search for related RITMs
			var ritm = new GlideRecord('sc_req_item');
			ritm.addQuery('request',input.requestId);
			ritm.query();
			//If exactly one RITM is returned, pass to the Client Controller to redirect user
			if(ritm.next() && (ritm.getRowCount() == 1)){
				data.ritmId = ritm.getUniqueValue();
			}
		}

Please mark this response as correct or helpful if it assisted you with your question.