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
sml9099sml9099 

Salesforce formulae field to capture yesterday's value

Hey , 
By any means, can we add formula or workflow rule to store yesterday's target in field and today's target  in different field? both these fields will change there values everyday everytime we refresh the records ?

Thanks
Nirmal ChristopherNirmal Christopher
Formula fields update real time data so i think you migh not ne able to use the formula field directly. instead you can try using prior value function in a  work flow field update to capture the updated old value in a new field and store the new value in another field.
Ashish_SFDCAshish_SFDC
Hi,


Formula fields are run only when the Record is loaded.

You have to use some alternatel means like schedule apex to run and store the value before hand.

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_scheduler.htm

Can you explain the scenario in more detail.


Regards,
Ashi
sml9099sml9099
Hi , 

we have filed called "TARGET UNITS". SQL scripts change this field value multiple times a day. I want to store the latest TODAY's value and also the latest value which one day before TODAY.
Ashish_SFDCAshish_SFDC
Hi , 


You can use the 

TEXT(PRIORVALUE(TARGET_UNITS__c)  and Use the ISCHANGED function on the Formula field

ISCHANGED( your_formula_field_name__c )

See more on the thread below, 

https://success.salesforce.com/answers?id=90630000000h2eUAAQ


Regards,
Ashish