Static Functions

Static functions have specialized use in template rules. This page covers static functions in the math, object, and sfdc_fma namespaces.

math:pow 

Parameters: Double base, Double exponent

Returns: Double

Recursive: Not supported

Description: Returns the value of the first argument raised to the power of the second argument.

Example 

This function call:

1{
2    "pow": "${math:pow(5, 5)}"
3}

Returns:

1{
2    "pow": 3125.0
3}

math:min 

Parameters: Double a, Double b

Returns: Double

Recursive: Not supported

Description: Returns the smaller of the two values.

Example 

This function call:

1{
2    "min": "${math:min(5, 10)}"
3}

Returns:

1{
2    "min": 5.0
3}

math:max 

Parameters: Double a, Double b

Returns: Double

Recursive: Not supported

Description: Returns the greater of the two values.

Example 

This function call:

1{
2    "max": "${math:max(5, 10)}"
3}

Returns:

1{
2    "max": 10.0
3}

math:round 

Parameters: Double x, Int scale

Returns: Double

Recursive: Not supported

Description: Rounds the given value to the specified number of decimal places.

Example 

This function call:

1{
2    "round": "${math:round(12.983665, 3)}"
3}

Returns:

1{
2    "round": 12.984
3}

object:contains 

Parameters: Object map, Object key

Returns: Boolean

Recursive: Not supported

Description: Returns if the map contains a non-null value at the specified key

Example 

For the following map:

1{
2    "fieldsMap": [{"field1": "ProductName"},
3                  {"field2": "Amount"},
4                  {"field3": "CompanyName"},
5                  {"field4": "Revenue"}]
6}

This function call:

1{
2    "contains": "${object:contains(Variables.fieldsMap, 'field3')}"
3}

Returns:

1{
2    "contains": true
3}

sfdc_fma:checkInteger 

Parameters: String apiName

Returns: Int

Recursive: Not supported

Description: Returns the integer value of the LMO to subscriber FMA value for checkPackageIntegerValue.

For more information and examples, see the Feature Management methods.

sfdc_fma:checkBoolean 

Parameters: String apiName

Returns: Boolean

Recursive: Not supported

Description: Returns the boolean value of the LMO to subscriber FMA value for checkPackageBooleanValue.

For more information and examples, see the Feature Management methods.

sfdc_fma:checkDate 

Parameters: String apiName

Returns: Date

Recursive: Not supported

Description: Returns the date value of the LMO to subscriber FMA value for checkPackageDateValue.

For more information and examples, see the Feature Management methods.