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

ParameterData TypeRequiredDescription
formula_stringStringYesThe formula to evaluate.
retrieve_source_fieldsStringYesA comma-separated list of source fields whose values are used as inputs when evaluating the formula.
relationship_name_optionalStringNoThe 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.
Evaluate Example