Redirect catalog item submission to Portal homepage instead of order status for specific catalog items

Balaraju K B
Tera Expert

Hi Team,

I want to redirect few specific catalog items to portal homepage after submitting instead of redirecting to Request summary page.

 

Thanks in Advance,

Bala

1 ACCEPTED SOLUTION

Anil Lande
Kilo Patron

Hi,

Redirection is handles in widget 'SC Catalog Item'. If you have customized this widget then you can make below changes. I have added sys_id of catalog item for which it will redirect user to portal home after submission. 

find_real_file.png

 

If you are using OOB widget then this is big change. You need to clone OOB widget and make above suggested changes. Then remove the OOB widget from 'sc_cat_item' page and replace the custom widget.

 

Note: This is not a best way as need customization and will affect OOB behavior. So I would suggest you to convince customer and do not make these changes.

 

Thanks,
Anil Lande 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

View solution in original post

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you can try this but I haven't tested

After insert business rule on RITM table

Condition: current.cat_item.name == 'Item 1' || current.cat_item.name == 'Item 2'

Script:

(function executeRule(current, previous /*null when async*/) {

	// Add your code here
	var url = '/sp'; // give your URL here
	gs.setRedirect(url);

})(current, previous);

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar No ankur this method is not working

Hey Ankur,

 

As Balaraju mentioned, this is not working. I have a requirement very similar but mine is as followed:
1. Submit Catalog Item on Portal
2. After submission, redirect from Portal to Interaction->New Record (within Instance)

Can this be done?

Anil Lande
Kilo Patron

Hi,

Redirection is handles in widget 'SC Catalog Item'. If you have customized this widget then you can make below changes. I have added sys_id of catalog item for which it will redirect user to portal home after submission. 

find_real_file.png

 

If you are using OOB widget then this is big change. You need to clone OOB widget and make above suggested changes. Then remove the OOB widget from 'sc_cat_item' page and replace the custom widget.

 

Note: This is not a best way as need customization and will affect OOB behavior. So I would suggest you to convince customer and do not make these changes.

 

Thanks,
Anil Lande 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande