292 views

How to resolve Record Producer/Catalog Item getting stuck at "Submitting..." in Service Portal



Description


When trying to submit a Record Producer and the "sc_cat_item" page is stuck at submitting and there is a 500 error on the console. This might be due to an exception on the nodelogs, Please see the below example

"...

java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.String

   Caused by error in sys_ws_operation.4b9f0a8967101200d22b794717415a30.operation_script at line 1

com.glideapp.servicecatalog.scoped.api.CatalogItemJS.jsFunction_submitProducer(CatalogItemJS.java:396)

..."

Procedure


This error occurs because there is a type mismatch when setting a variable. To troubleshoot this follow the steps below,

  1. Find the affected variable associated to the Catalog Item / Record producer
  2. Look for client script setting this variable, You could do that by search this by applying the following filter on "catalog_script_client" table
    Filter: "Script" "Contains" "<Variable Name>"
  3. Make sure the variable type and the value matches, for example

For a have a variable mapped to a string type dictionary entry and there is a client script setting

g_form.setValue("variable_name",1);

This exception would occur, Please set the value to a string by replacing with the following code,

g_form.setValue("variable_name","1");

Applicable Versions


ALL

Additional Information


Similar kind of error can occur when you are setting an object directly to a string field, For example,

Variable: A 

Type: Multi Line Text

Client Script:

var arr = []; // creating an array object

g_form.setValue("A", arr);

 

To resolve this you would need to convert the Array object to a string using "toString()" method, Please see the below example

var arr = [];

g_form.setValue("A", arr.toString());

Article Information

Last Updated:2018-04-17 06:27:59
Published:2018-04-12