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:
{
"pow": "${math:pow(5, 5)}"
}
Returns:
{
"pow": 3125.0
}
math:min
Parameters: Double a, Double b
Returns: Double
Recursive: Not supported
Description: Returns the smaller of the two values.
Example
This function call:
{
"min": "${math:min(5, 10)}"
}
Returns:
{
"min": 5.0
}
math:max
Parameters: Double a, Double b
Returns: Double
Recursive: Not supported
Description: Returns the greater of the two values.
Example
This function call:
{
"max": "${math:max(5, 10)}"
}
Returns:
{
"max": 10.0
}
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:
{
"round": "${math:round(12.983665, 3)}"
}
Returns:
{
"round": 12.984
}
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:
{
"fieldsMap": [{"field1": "ProductName"},
{"field2": "Amount"},
{"field3": "CompanyName"},
{"field4": "Revenue"}]
}
This function call:
{
"contains": "${object:contains(Variables.fieldsMap, 'field3')}"
}
Returns:
{
"contains": true
}
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.