You need to sign in to do that
Don't have an account?
lodoss118
Child relationship queries help?
Hi i have a custom object called sales order now i want to find out all the sales orders that have a note or attachment
i done this but i am not sure how to define to only show if there is an attachment or note
Select s.Id, (Select Id, ParentId From Notes), (Select Id, ParentId From Attachments) From SCRB_SalesOrder__c s
????
this doesn't work?
Select s.Id, (Select Id, ParentId From Notes Where Id != null),
(Select Id, ParentId From Attachments Where Id != null) From SCRB_SalesOrder__c s
i done this but i am not sure how to define to only show if there is an attachment or note
Select s.Id, (Select Id, ParentId From Notes), (Select Id, ParentId From Attachments) From SCRB_SalesOrder__c s
????
this doesn't work?
Select s.Id, (Select Id, ParentId From Notes Where Id != null),
(Select Id, ParentId From Attachments Where Id != null) From SCRB_SalesOrder__c s
Instead, run a query on the notes and attachments:
select id, parentid from attachment where parent.type = 'SCRB_SalesOrder__c'
select id, parentid from note where parent.type = 'SCRB_SalesOrder__c'