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

Evaluate functional expressions:

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

Define custom functions:

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

Use custom functions:

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

Evaluate scripts:

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