Business Rules: Restriction to not use global variables will be applied more consistently

Dear customers and partners,

Like mentioned in the documentation of SAP Field Service Management - Administration – Business Rules, the feature to enter JavaScript expressions is designed for simple expressions. It is not supported to define sophisticated constructs like global classes, global functions, or global variables within these JavaScript expressions.

In the past, it could be the case that you have defined global variables within JavaScript expressions of Business Rules, and it sometimes worked successful and sometimes failed.

After the 15th of February such rules will always fail.
Therefore in case you are using global variables within business rules, we recommend improving them.

Example, how it should not be done:

Variable Name

Variable
Type

Object Type

Object
Version

Core SQL WHERE Clause

syncObject

Object

SyncObject

10

 

variable1

Value

   

${var globalVariable = "A"}

variable2

Value

   

${globalVariable + "B"}

 


Improved example, how it should be done:

Variable Name

Variable
Type

Object Type

Object
Version

Core SQL WHERE Clause

syncObject

Object

SyncObject

10

 

globalVariable

Value

   

A

variable2

Value

   

${globalVariable + "B"}

 


Additional background information: this more consequent check related to global variables within JavaScript expressions is happening due to an update of the underlying JavaScript engine. This update is needed to improve usage of system resources and performance during business rule executions.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

0 comments

Article is closed for comments.