You need to sign in to do that
Don't have an account?
Yaari Vidanpeled
How do I retrieve data after setting Field History
Hello,
I am a newbie to Salesforce. After setting up Field History for Opportunities Object I wish to retrieve data for a specific field eg. `Account Name`. Can I have an example regarding how this can be done.
Thank you in advance for any help rendered
I am a newbie to Salesforce. After setting up Field History for Opportunities Object I wish to retrieve data for a specific field eg. `Account Name`. Can I have an example regarding how this can be done.
Thank you in advance for any help rendered
go Setup - Object Manager - Fields & Relationships - Set History Tracking (upper right corner)
Choose Account Name as a field to track. If you change the value, you will see the changes in the history related list.
If this helps, please mark as Best Answer to help others too.
You can export field history data using Data Loader.
Review below link for same.
https://help.salesforce.com/articleView?id=000318128&language=en_US&type=1&mode=1
Hope above information was helpful.
Please mark as Best Answer so that it can help others in the future.
Thanks,
Vinay Kumar
My query looked like this:
SELECT CreatedById, CreatedDate, Field, Id, IsDeleted, NewValue, OldValue, OpportunityId FROM OpportunityFieldHistory
But I wish to Inner Join the data with the Name field in Opportunity. If it was a regualar inner join query I would use something along the lines of:
SELECT a.CreatedById, a.CreatedDate, a.Field, a.Id, a.IsDeleted, a.NewValue, a.OldValue, a.OpportunityId FROM OpportunityFieldHistory a, b.Name INNER JOIN Opportunity b ON a.OpportunityId=b.Id
That did not work unfortunatly. Then I tried the following Query
SELECT CreatedById, CreatedDate, Field, Id, IsDeleted, NewValue, OldValue, OpportunityId FROM OpportunityFieldHistory WHERE OpportunityId in (SELECT Name FROM Opportunity)
Please Help!!!!
Try to use below query.
SELECT CreatedById, CreatedDate, Field, Id, IsDeleted, NewValue, OldValue, OpportunityId FROM OpportunityFieldHistory WHERE OpportunityId in (SELECT id FROM Opportunity) .
Thanks,
Vinay Kumar
I actually need the name from Opportunity and I have the Id of the record which is the value of OpportunityId.
Thanks,
Yaary Vidanpeled