You need to sign in to do that
Don't have an account?
Homelike Development
Best way of querying account history (and related accounts)
I would like to query the account history where I am excluding certain account record types.
I am developing the query in Workbench and am currently using the Workbench SOQL query tab.
As a first step I tried to get the Account.RecordTypeId, but neither of the following worked (after allowing for querying parent-child relationships in settings):
Ultimately I am using the query to get data via the python package Simple Salesforce. Alternative approaches are also welcome.
I am developing the query in Workbench and am currently using the Workbench SOQL query tab.
As a first step I tried to get the Account.RecordTypeId, but neither of the following worked (after allowing for querying parent-child relationships in settings):
SELECT AccountId.RecordTypeId FROM AccountHistory LIMIT 10Fails with: "Didn't understand relationship 'AccountId' in field path."
SELECT AccountId__r.RecordTypeId FROM AccountHistory LIMIT 10Fails with: "Didn't understand relationship 'AccountId__r' in field path."
SELECT AccountId.RecordTypeId__r FROM AccountHistory LIMIT 10Fails with: "Didn't understand relationship 'AccountId' in field path."
Ultimately I am using the query to get data via the python package Simple Salesforce. Alternative approaches are also welcome.
Sorry my bad, please paste the below query format in the workbench and try. Please refer to the similar link below
https://developer.salesforce.com/forums/?id=9060G000000BdqcQAC
Hope this helps, please mark as solved if it does
Thanks
All Answers
Please try this query for extracting all the accounts and there related activity history records filtered with excluding record type . Replace your recordtypeid in the query.
Hope this helps! Please mark as best answer if it solves your problem.
Thanks
Does not work, unfortunately, you are selecting from ActivitiesHistories and not from AccountHistory
Sorry my bad, please paste the below query format in the workbench and try. Please refer to the similar link below
https://developer.salesforce.com/forums/?id=9060G000000BdqcQAC
Hope this helps, please mark as solved if it does
Thanks
Cheers