Redirecting Service Portal Catalog Items and Troubleshooting Submission & Search IssuesIssue <!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Issue 1: Redirecting a Service Portal Catalog Item After Submission Symptoms Administrators need to redirect users to a specific page after submitting a catalog item or record producer in the Service Portal. Resolution 1. Redirect Using the SC Catalog Item Widget (Widget Instance Level) To configure a redirect for all catalog item submissions: Navigate to: /sp?id=sc_cat_itemPress Ctrl + Right‑Click and select Instance Options.Configure the following fields: Successful Order Page – Select the page users should be redirected to after submission.Successful Order Table – Select the table used to generate the success message link. (Optional) Enable Auto-Redirect on Successful Order to automatically redirect users without requiring them to click the success message link. Once configured, the success message link and/or auto‑redirect will take users to the desired page or record. 2. Redirect Using Record Producer Script For script‑based redirection on a Record Producer, set the portal_redirect property: producer.portal_redirect = "?id=sc_home";This redirects the user to the specified Service Portal page after the record producer is submitted. Issue 2: Catalog Item Stuck at “Submitting…” With 400 (Bad Request) Symptoms Catalog item submission hangs at “Submitting…”. Browser console shows: 400 (Bad Request)"Mandatory variables are not filled" System logs show BadRequestError from the Service Catalog REST API. Errors in Browser Console: uri: "api/sn_sc/v1/servicecatalog/items/bcf9c7129525d6405fabdeba66ae2a4c/submit_producer 400 (Bad Request) {error: {…}, status: "failure"} error : detail : "" message : "Mandatory variables are not filled" __proto__ : Error in logs 2018-04-18 09:21:06 (638) API_INT-thread-1 A32A62A50F691300B04F419CE1050EFC txid=61ebae2d0f2d SEVERE *** ERROR *** Root cause of JavaScriptException: com.glide.rest.service.custom.errors.ScriptableBadRequestError JavaScript evaluation error on: (function process(/*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) { var request_body = request.body.nextEntry(); var quantity = '' + request_body.sysparm_quantity; if (!/^\+?([0-9]*)$/.test(quantity)) throw new sn_ws_err.BadRequestError("Invalid Quantity value"); else request_body.sysparm_quantity = quantity; var itemId = '' + request.pathParams.sys_id; request_body.sysparm_id = itemId; var catItem = new sn_sc.CatItem(itemId); if (!catItem.canView()) throw new sn_ws_err.BadRequestError("Security constraints prevent ordering of Item"); var catUtil = new RestCatalogUtil(); if (!catUtil.checkMandatoryVariables(itemId, request_body.variables)) throw new sn_ws_err.BadRequestError('Mandatory Variables are required'); var cart = new sn_sc.CartJS("cart_" +itemId); request_body.sysparm_cart_name = "cart_" +itemId; try { return cart.orderNow(request_body); }catch(e) { gs.debug(e); throw new sn_ws_err.NotFoundError("Invalid Request"); } })(request, response); 2018-04-18 09:21:06 (639) API_INT-thread-1 A32A62A50F691300B04F419CE1050EFC txid=61ebae2d0f2d SEVERE *** ERROR *** JavaScript evaluation error on: (function process(/*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) { var request_body = request.body.nextEntry(); var quantity = '' + request_body.sysparm_quantity; if (!/^\+?([0-9]*)$/.test(quantity)) throw new sn_ws_err.BadRequestError("Invalid Quantity value"); else request_body.sysparm_quantity = quantity; var itemId = '' + request.pathParams.sys_id; request_body.sysparm_id = itemId; var catItem = new sn_sc.CatItem(itemId); if (!catItem.canView()) throw new sn_ws_err.BadRequestError("Security constraints prevent ordering of Item"); var catUtil = new RestCatalogUtil(); if (!catUtil.checkMandatoryVariables(itemId, request_body.variables)) throw new sn_ws_err.BadRequestError('Mandatory Variables are required'); var cart = new sn_sc.CartJS("cart_" +itemId); request_body.sysparm_cart_name = "cart_" +itemId; try { return cart.orderNow(request_body); }catch(e) { gs.debug(e); throw new sn_ws_err.NotFoundError("Invalid Request"); } })(request, response); org.mozilla.javascript.JavaScriptException: [object BadRequestError] (sys_ws_operation.4f9131449f901200d54dd4b4232e708d.operation_script; line 18) at org.mozilla.javascript.gen.sys_ws_operation_4f9131449f901200d54dd4b4232e708d_operation_script_4345._c_process_1(sys_ws_operation.4f9131449f901200d54dd4b4232e708d.operation_script:18) at org.mozilla.javascript.gen.sys_ws_operation_4f9131449f901200d54dd4b4232e708d_operation_script_4345.call(sys_ws_operation.4f9131449f901200d54dd4b4232e708d.operation_script) at org.mozilla.javascript.ScriptRuntime.doCall2(ScriptRuntime.java:2650) at org.mozilla.javascript.ScriptRuntime.doCall(ScriptRuntime.java:2590) at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:42) at org.mozilla.javascript.gen.sys_ws_operation_4f9131449f901200d54dd4b4232e708d_operation_script_4345._c_script_0(sys_ws_operation.4f9131449f901200d54dd4b4232e708d.operation_script:1) at org.mozilla.javascript.gen.sys_ws_operation_4f9131449f901200d54dd4b4232e708d_operation_script_4345.call(sys_ws_operation.4f9131449f901200d54dd4b4232e708d.operation_script) at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:563) at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3428) at org.mozilla.javascript.gen.sys_ws_operation_4f9131449f901200d54dd4b4232e708d_operation_script_4345.call(sys_ws_operation.4f9131449f901200d54dd4b4232e708d.operation_script) at org.mozilla.javascript.gen.sys_ws_operation_4f9131449f901200d54dd4b4232e708d_operation_script_4345.exec(sys_ws_operation.4f9131449f901200d54dd4b4232e708d.operation_script) at com.glide.script.ScriptEvaluator.execute(ScriptEvaluator.java:263) at com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:110) at com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:76) at com.glide.script.fencing.GlideScopedEvaluator.evaluateScript(GlideScopedEvaluator.java:309) at com.glide.script.fencing.GlideScopedEvaluator.evaluateScript(GlideScopedEvaluator.java:214) at com.glide.script.fencing.GlideScopedEvaluator.evaluateScript(GlideScopedEvaluator.java:201) at com.glide.rest.service.custom.CustomService.runScript(CustomService.java:95) at com.glide.rest.service.custom.CustomService.execute(CustomService.java:82) at com.glide.rest.handler.impl.ServiceHandlerImpl.invokeService(ServiceHandlerImpl.java:36) at com.glide.rest.processors.RESTAPIProcessor.process(RESTAPIProcessor.java:271) at com.glide.processors.AProcessor.runProcessor(AProcessor.java:483) at com.glide.processors.AProcessor.processTransaction(AProcessor.java:205) at com.glide.processors.ProcessorRegistry.process0(ProcessorRegistry.java:178) at com.glide.processors.ProcessorRegistry.process(ProcessorRegistry.java:167) at com.glide.ui.GlideServletTransaction.process(GlideServletTransaction.java:31) at com.glide.sys.Transaction.run(Transaction.java:2038) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) 2018-04-18 09:21:06 (642) API_INT-thread-1 A32A62A50F691300B04F419CE1050EFC txid=61ebae2d0f2d #5706 [REST API] RESTAPIProcessor : Mandatory Variables are required Cause The catalog item contains mandatory variables that are hidden by: Catalog UI PoliciesCatalog Client ScriptsIf a mandatory variable is hidden at runtime, the Service Portal REST API rejects the submission. Resolution Review all variables on the catalog item (including variable sets).Identify variables where Mandatory is checked.Check for UI Policies or Client Scripts that hide these variables.If a mandatory variable is hidden, uncheck the Mandatory flag at the variable level.If no scripts hide mandatory variables but the issue persists:Ensure the portal page uses the out-of-the-box “SC Catalog Item” widget. Issue 3: Service Portal Catalog Item Search Returns No Results Symptoms Typeahead search in the Service Portal does not return the expected catalog items. Cause The catalog item is not included in the catalog referenced by the sp_portal record used by the current portal. Resolution Open the sp_portal record for the portal where the search is performed.Check the Catalog field.Ensure the catalog item is included in the catalog associated with that portal. Release<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } All versions included Resolution<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Each issue has a separate resolution in its own column. Kindly refer under resolution heading. Related Links<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } }