• Andrew McGrath
  • NEWBIE
  • 20 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 4
    Replies
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
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
Hi

Been looking around with no luck - is there a simple equivalent to the SQL not null statement in SOQL (ie return rows where the column contains a value?)

Current query:

SELECT Id, Name, customfield__c from Account
Where customfield__c !=null

Any help greatly appreciated! I feel the answer is obvious but it is driving me mad. 

Cheers



 
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
Hi

Been looking around with no luck - is there a simple equivalent to the SQL not null statement in SOQL (ie return rows where the column contains a value?)

Current query:

SELECT Id, Name, customfield__c from Account
Where customfield__c !=null

Any help greatly appreciated! I feel the answer is obvious but it is driving me mad. 

Cheers



 

In my application I retrieve attachment parent information with the following query:

 

SELECT id, parent.id, parent.name, parent.type FROM Attachment WHERE parent.type = 'xxxx'

 

However, when I execute this same query for Task or Event object types:

 

SELECT id, parent.id, parent.name, parent.type FROM Attachment WHERE parent.type = 'Task'

 

I get attachment objects but the 'Parent' field is null. This query works for every other object type, so it doesn't look like this is expected behavior. The 'parent.type' variable seems to be available because the WHERE clause correctly filters the results, but that same field is returning null in the query result.

 

Has anyone been through this issue before? Can anyone confirm this is not a problem with my Salesforce environment?