Newer Version Available

This content describes an older version of this product. View Latest

FormulaEval Namespace (Beta)

The FormulaEval namespace provides classes and methods to evaluate user-defined dynamic formulas for Apex objects and SObject types. Use the methods to avoid unnecessary DML statements to recalculate formula field values or evaluate dynamic formula expressions.

This feature is a Beta Service. Customer may opt to try such Beta Service in its sole discretion. Any use of the Beta Service is subject to the applicable Beta Services Terms provided at Agreements and Terms. You can provide feedback and suggestions for the feature in the Trailblazer Community.

Note

When using a formula against an Apex object, the class methods or properties referenced by the formula must be global. Formula evaluation in Apex is bound by the formula field character limit, but not the compile size limit. Formula fields can reference Apex types such as a location or an address. The values contained in individual components of such Apex types are accessed and evaluated by the formula.

Formula in Apex supports the following System types

The following are the classes and enums in the FormulaEval namespace.