Service Catalog and Service Point have a different behavior when loading a form which loads a custom script code
search cancel

Service Catalog and Service Point have a different behavior when loading a form which loads a custom script code

book

Article ID: 231618

calendar_today

Updated On:

Products

CA Service Management - Service Desk Manager CA Service Catalog

Issue/Introduction

Certain fields of a form are configured through a code to be hidden under some statuses. This works OK in Service Catalog but not in Service Point.

 

Code being used:

$(_.request.status<418) || $(_.request.status>418)

error in F12 Developer tool > console
SyntaxError: Unexpected token ')'

Environment

Release : 17.3

Component : SDM - Service Point

Cause

Error in the javascript code being used

Resolution

Change the script code from:   

$(_.request.status<418) || $(_.request.status>418)  

to

$(_.request.status<418 || _.request.status>418)

Technically catalog/Servicepoint removes the first and last braces and evaluates the javascript in this case _.request.status<418) || $(_.request.status>418  . so since ) is not a valid expression it gives us the error.  In Catalog/SP  this error is thrown in the console.