Formula Class
Namespace
Usage
Use the Formula class in conjunction with the FormulaBuilder and FormulaInstance classes in the FormulaEval namespace.
Example
This example creates a formula instance using Formula.builder() and the FormulaBuilder methods.
Formula Methods
The following are methods for Formula.
builder()
Signature
public static formulaeval.FormulaBuilder builder()
Return Value
recalculateFormulas(sobjects)
Signature
public static List<System.FormulaRecalcResult> recalculateFormulas(List<SObject> sobjects)
Parameters
- sobjects
- Type: List<SObject>
- List of sObjects whose formula fields are to be recalculated.
Return Value
Type: List<FormulaRecalcResult Class>
Usage
Recalculate formula fields on new or queried SObjects. If all data is present on the SObjects, SOQL limits are not affected. If the data required to evaluate a formula field is missing, that data is retrieved and limits are changed accordingly.
The new formula values are stored in the SObjects themselves and overwrite previous values of formula fields.