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

how to write the soql query for fetching the notes and attachment related list
i have a custom oject name has brand and i need show the notes and atachment records in the new window i already done with standard controller but nw i need to use the extension controller how can i fetch that with soql query
As per your requirment ,we can write your query like this
first you need get customobjectId by using Apexpages.currentpages().getparameter().get('Id');
for note :select id from note where parentId=:customobject Id;
in same way for Attachment:select id from attachment where parentId=:customobject.Id;
You may get all notes and attachments for particular record according to id which ur passing.
If you satisfy with Hit Kudos if this provides you with useful information and if this is what you where looking for then please mark it as a solution for other benefits.
Thank You,
Srinivas
SFDC Certified Developer
You can try like this Thanks,
Riyas