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
sunny sengar 17sunny sengar 17 

How to retrieve data under production org

We created a flow on custom object(Receivables__c) and based on certain condition we wanted to update related Parent object(Sale__c) record. But accidently the flow updated all sales__c object record instead of just related one. Now we would like to retrieve to old/Actual record those got updated because of the flow. Please let us know if there is any way to get old records which was updated.
SwethaSwetha (Salesforce Developers) 
HI Sunny,
Does the custom object sales__c have Field History enabled?
If so, you can run a query like below to retrieve old values

SELECT Id, ParentId, Field, OldValue, NewValue FROM CustomObject__History

Related: https://salesforce.stackexchange.com/questions/279946/how-to-create-a-record-histroy-c-custom-object-with-old-values-and-new-valu

https://help.salesforce.com/s/articleView?id=sf.tracking_field_history_for_custom_objects.htm&type=5

Recover records and data in Salesforce : https://help.salesforce.com/s/articleView?id=000321526&type=1

Records Created, Updated or Deleted Unexpectedly: https://help.salesforce.com/s/articleView?id=000313253&type=1


If this information helps, please mark the answer as best. Thank you