function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SIVAKOTESWARARAO DUDDUKURISIVAKOTESWARARAO DUDDUKURI 

how to calculate formula field in sobject?

Suraj MakandarSuraj Makandar
Hi,

Formula fields are automatically calculated. So every time you visit the record you will see the updated/new values.

Thanks,
Suraj
Devi ChandrikaDevi Chandrika (Salesforce Developers) 
Hi sivakoteswararao,

Basically a formula field  is used to  automatically calculate the value of a field based on other fields.So whenever you want to calculate a value based on other fields then you can create a formula field .
In formula you can use values of fields, operators, functions, literal values, or other formulas and frame a formula according to your requirements.

Please refer below link which might help you further.
https://help.salesforce.com/articleView?id=customize_formulas.htm&type=5 (https://help.salesforce.com/articleView?id=customize_formulas.htm&type=5)
https://help.salesforce.com/articleView?id=customize_formuladef.htm&type=5 (https://help.salesforce.com/articleView?id=customize_formuladef.htm&type=5)
https://trailhead.salesforce.com/en/content/learn/modules/point_click_business_logic/formula_fields

Hope this helps you
Let me know if this helps you. Kindly mark it as solved so that it may help others in future.

Thanks and Regards
 
Fernando Rodrigues Ribeiro Martins 8Fernando Rodrigues Ribeiro Martins 8

Hi everyone,

SIVAKOTESWARARAO DUDDUKURI, you can use this 'Formula' class.

Here is the link for documentation:

Formula Class (https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_System_Formula.htm)