Skip to main content
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):

 

SELECT AccountId.RecordTypeId FROM AccountHistory LIMIT 10

Fails with: "Didn't understand relationship 'AccountId' in field path."

 

SELECT AccountId__r.RecordTypeId FROM AccountHistory LIMIT 10

Fails with: "Didn't understand relationship 'AccountId__r' in field path."

 

SELECT AccountId.RecordTypeId__r FROM AccountHistory LIMIT 10

Fails 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.

 
4 Antworten
  1. 17. Jan. 2020, 23:01
    Hi,

    Sorry my bad, please paste the below query format in the workbench and try.

    Select Accountid,

    Account.name,

    Account.recordtypeId

    From Accounthistory where

    account.RecordtypeId!=‘012580000004SxCAAU'

    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
0/9000