Newer Version Available
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.
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.