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
❤Code❤Code 

Refreshing Formula Fields Dynamically without save

Hi All,

Is there anyway to force an object to recalculate it's formula fields, either through standard or extended controllers in visualforce page(Mostly using action:suppot).
While googling i found in Winter 16 release recalculateFormulas()  method is introduced.. But i dont know how to use it. Has anybody used this method.

Regards
Antonio ManenteAntonio Manente
You just call it on the object you'd like to recalculate the fields on... e.g.
Account acc = [SELECT ....... FROM Account WHERE ....];
acc.recalculateFormulas();

 
Marcio FritschMarcio Fritsch
It will not work if you picked a master-detail field into the query.