I want to retrieve Notes And Attachments that are attached with the record of a custom object in a single query .How can i do this?
SELECT Id,Name,(SELECT Id,Title FROM Notes),
(SELECT Id,Name FROM Attachments)
FROM My_Custom_Object__c WHERE id='01a4s7dfsaawZAE'
i have tried to solve it using the above query but through this i am not able to acces notes and attachments in apex.if i run this query in developer console it is showing me the notes and attachments of that record.How can i access same in apex.