You need to sign in to do that
Don't have an account?

Need to run a report to get all Accounts that doesn't have attachments
Need to run a report to get all Accounts that has close won opportunities and don't have attachments related to them
i am not sure if i can approach this using report or SOQL
what is the best approach to use here
Thanks in Advance
i am not sure if i can approach this using report or SOQL
what is the best approach to use here
Thanks in Advance
SELECT ID FROM Account WHERE ID NOT IN (SELECT ParentID FROM Attachment)
A more efficient, future proof method of doing it would be to mark your accounts as having or not having attachments using a trigger on the attachment object. The trigger would control a checkbox that you would use to report.
I hope you find the above information is helpful. If it does, please mark as Best Answer to help others too.
Thanks.
SELECT Id, Name,(SELECT stageName FROM Opportunities where stageName = 'Closed Won'),(SELECT Title,ParentId FROM CombinedAttachments) FROM Account WHERE ID NOT IN (SELECT ParentId FROM CombinedAttachments )
but I keep getting this error I try to add filter using recordType = 'Account' didn't work as well