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.
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?
Do you want to display this link in a public site?
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.
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?
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.
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.