function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Gaurav RajGaurav Raj 

How to query a file id and appent it to the salesforce url?

How to query a file id from a custom objects Notes and Attachment and append this id to the salesforce's url?

 

can someone help me with the code

jungleeejungleee

If you want to query the attachment from the note and attachment of an associated object, then 1st you should know your parent object and then fire a query again the attachment object from where you can get you're file id

 

//Capture the account Id first;
id accountId = 'yourAccountid';


//Then get all the attachment records associated to the account
list<attachment> attachmentList = [select id, name from attachment where parentId =: accountId];