I'm trying to make an SOQL query to the CampaignMember table, which checks both the Campaign of the CampaignMember and the ParentCampaign of that CampaignMember.
The Campaign.ParentId works, but the Campaign.ParentCampaign doesn't, telling me it doesn't exist, despite it being in the list of available fields on the Campaign object.
My SOQL query looks like this:
SELECT Contact.Account.MauticID__c, Campaign.MtcSID__c, Campaign.ParentId, Campaign.ParentCampaign FROM CampaignMember WHERE (CampaignId IN :cids OR (Campaign.ParentId IN :cids AND Campaign.ParentCampaign.MtcSID__c != NULL)) AND Contact.Account.MauticID__c != NULL AND Contact.Account.MtcPossibleSpamsniffer__c = FALSE AND Contact.Account.NoEmails__c = FALSE AND MtcInMautic__c = FALSE
which gives the error "No such column 'ParentCampaign' on entity 'Campaign'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names."
I've also tried Campaign.Parent (as that is the field's name according to the Salesforce setup page), but that gives the same error.