Script

Function

Description

uEvaluate

Evaluates a function or JavaScript expression and returns the result




uEvaluate

Description

Evaluates a function or JavaScript expression and returns the result

Syntax

string uEvaluate(expression)

Parameters

Number expression

JavaScript code to evaluate

Examples

Example 1

Evaluation functional expressions:

uEvaluate("3 + 5")
uEvaluate("parseFloat(IN.Salary) + 1500")

Defining custom functions:

uEvaluate("function timesTwo(a){ return a*2; }")

Using custom functions:

uEvaluate("timesTwo(4)")
uEvaluate("timesTwo(IN.Salary)")

Evaluating scripts:

uEvaluate("if ("parseFloat(IN.Salary) > 2000") {2000;}
else {("parseFloat(IN.Salary) + 500");}")