---
schema_version: "1"
id: ca8589e6c5ca8a61fe41ad1e36814f6ee8175d307f9b23b7b9da07f6b3e1f6c3
title: FormulaRecalcResult Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_class_System_FormulaRecalcResult.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_System_FormulaRecalcResult.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 884da242172e550d7266b915d8740de48e563feec386b6dd337660d5d927aa31
description: The return type of the Formula.recalculateFormulas method.If an error occurs during formula recalculation, an array of one or more database error objects, along with error codes and descriptions, is returned.Returns the sObject with formulas recalculated.Returns a Boolean value that is set to true if the formula recalculation process completed successfully; otherwise, it is set to false.
---
# FormulaRecalcResult Class

The return type of the Formula.recalculateFormulas method.

## Namespace

[System](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_namespace_System.htm "The System namespace provides classes and methods for core Apex functionality.")

## Usage

Indicates the result and status of recalculating formulas on a single sObject. Holds a reference to the sObject and a list of all the fields that were recalculated.

## Example

This example assumes that you have a formula field called divide\_\_c with formula “1 / LEN(Name).

List<Account> accounts = \[SELECT Name FROM Account WHERE Name='Acme' WITH USER\_MODE\];
accounts\[0\].Name = '';
List<FormulaRecalcResult> results = Formula.recalculateFormulas(accounts);
FormulaRecalcResult result0 = results\[0\];
FormulaRecalcFieldError fieldError = result0.getErrors()\[0\];
System.debug(fieldError.getFieldName()); // 'divide'
System.debug(fieldError.getFieldError()); // 'Division by zero'

- **[FormulaRecalcResult Methods](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_System_FormulaRecalcResult.htm#apex_System_FormulaRecalcResult_methods)**

## FormulaRecalcResult Methods

The following are methods for FormulaRecalcResult.

- **[getErrors()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_System_FormulaRecalcResult.htm#apex_System_FormulaRecalcResult_getErrors)**  
    If an error occurs during formula recalculation, an array of one or more database error objects, along with error codes and descriptions, is returned.
- **[getSObject()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_System_FormulaRecalcResult.htm#apex_System_FormulaRecalcResult_getSObject)**  
    Returns the sObject with formulas recalculated.
- **[isSuccess()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_System_FormulaRecalcResult.htm#apex_System_FormulaRecalcResult_isSuccess)**  
    Returns a Boolean value that is set to true if the formula recalculation process completed successfully; otherwise, it is set to false.

### getErrors()

If an error occurs during formula recalculation, an array of one or more database error objects, along with error codes and descriptions, is returned.

#### Signature

public List<System.FormulaRecalcFieldError> getErrors()

#### Return Value

Type: List<[FormulaRecalcFieldError Class](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_System_FormulaRecalcFieldError.htm#apex_class_System_FormulaRecalcFieldError "The return type of the FormulaRecalcResult.getErrors method.")\>

### getSObject()

Returns the sObject with formulas recalculated.

#### Signature

public SObject getSObject()

#### Return Value

Type: [SObject](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_sobject.htm#apex_methods_system_sobject "Contains methods for the sObject data type.")

### isSuccess()

Returns a Boolean value that is set to true if the formula recalculation process completed successfully; otherwise, it is set to false.

#### Signature

public Boolean isSuccess()

#### Return Value

Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.")