Redirect to new catalog item onsubmit


Description

If there is a requirement to open another catalog item on-submit based on the selection of field value in the current catalog item, then we cannot open the new item on the same tab of the browser. Onsubmit performs the Service Catalog API to insert a record on server side and return to checkout page to show the request details. So a new item on submit can be called on the new tab of the browser

Instructions

As an example: In a Platform, to open a catalog item 'ABC Test item' in a new tab on-submitting the existing catalog item 'XYZ Test item'

Example: Create an onsubmit catalog client script of the 'XYZ Test item' catalog item having field 'IP type' with values 'static' and 'dynamic'. On selecting 'dynamic', 'ABC TEST' catalog item to open on submission.

Result: 'ABC Test item' catalog item opens in a new tab and existing tab has active transaction of 'XYZ Test item' catalog item to show the checkout page of request submitted.

var gr = g_form.getValue('ip_type');

if (gr == 'dynamic')

{

window.open('/com.glideapp.servicecatalog_cat_item_view.do?v=1&sysparm_id=<sysID of 'ABC Test Item' catalog Item>','_blank');

}