EVALUATE
Description
Returns the value of a formula stored in a custom field, evaluated at runtime. Optionally retrieves fields from related records.
Syntax
EVALUATE(formula_string, retrieve_source_fields, relationship_name_optional) -> Object
Parameters
| Parameter | Data Type | Required | Description |
|---|---|---|---|
| formula_string | String | Yes | The formula to evaluate. |
| retrieve_source_fields | String | Yes | A comma-separated list of source fields whose values are used as inputs when evaluating the formula. |
| relationship_name_optional | String | No | The Object name used to retrieve fields from a related record. |
Example
-- PricingRule__c is a custom field on OpportunityLineItem
-- Example pricing rule: IF(Quantity >= 10000, UnitPrice * 0.9, UnitPrice)
-- Quantity = 18000, UnitPrice = 100 → returns 90.