I have updated one object records with wrong SOQL, how can I set all values as previous?

| improve this question | | | | |
  • Did you have history tracking on the field? If not, is there a way to determine the old values? – rael_kid Jun 6 '19 at 8:49
  • Yes, there is history tracking – Halil İbrahim Özdemir Jun 6 '19 at 8:56
  • post your query and what value(s) has been chaged. – cloudZigZag Jun 6 '19 at 8:58
  • If there's history tracking you can simply use the history tracking table to restore the old values. Just use SELECT OldValue, NewValue, FieldName FROM MyObject__History WHERE CreatedDate = :aroundTheTimeYouDidTheUpdate AND FieldName = 'MyField__c' – rael_kid Jun 6 '19 at 9:00
  • I need to do this dynamiclly because there are many records – Halil İbrahim Özdemir Jun 6 '19 at 9:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.