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
vinothvinoth 

Notes and attachment

Hi,

 

How can i provide a link in an object record  dynamically to an notes and attachment presnt in another object record.

 

 

 

cloudmaniacloudmania

Do you want to display this link in a public site?

vinothvinoth

We have two object A and B. we created lookup in A to B and for the particular record we have attached some document in B example record 123.while creating a record in A we will select a record 123 in lookup field.I want to provide a custom link in object A which show the detail of attachment of object B by clicking that link.

cloudmaniacloudmania

I need some more detail.CAn you clear which one is child A or B? And the link that you want to provide will be in Page Layout in Salesforce or in a public site?So I want to know have you any controller class or you want to satisfy this by using salesforce built-in functionality?

vinothvinoth

B is child and A is parent.link should be in page layout and i want to do this by using saleforce built in functionality.

ngabraningabrani

From B you can get the object id of A, that it looks up to.

 

After this you can do a SOQL query in Apex to get attachments that have parent id equal to A (http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_attachment.htm ).

 

Once we have the id of the attachment, this can be displayed as a link.