function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Andrew McGrathAndrew McGrath 

SOQL - Attachment returns null value for Parent ID

Hi

When I run a query on attachments to pull their parent id, it works fine for eg Accounts:

Select id, parent.id from Attachment
where parent.type = 'Account'

However for Tasks I get only a <null parent> return:

select id, parent.id from attachment
where parent.type = 'Task'

Does anyone have the answer to this or a workaround?

Cheers, 

Andy