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
Sumant KSumant K 

How can we associate one attachment to multipule objects?

Hi,
We have a requirement that we need to give Custom attachment reference to different objects (like Accounts/ opportunities) .i.e. As soon as user uploads a file, we need to assosiate that attachment to Objects so user click on those object can see the attachments as well. Please share your thoughts/ideas on this?

Sumant K
Satish.jgecSatish.jgec
Can there be multiple attachments which need to be linked to the object?
You can write a trigger on the attachment object to accomplish this and then create a text field on the objects which will hold the attachment Ids.
Once the user clicks on the object, you can write a VF to pop the attachment in a screen.
Sumant KSumant K
Hi Satish,
Thanks for your reply ..!
Probably i didn't question prorperly.  Not the multiple attachments to one object, one attachment references(copies) to multiple objects. Any possibilities on that?

 
Satish.jgecSatish.jgec
Thia is also possible but I would need some more details such as if you want the attachment to be linked to say for example account and Contact, then would you always need the same account record / contact record to have the atachment link?
How would you identify which account or contact record should have the link to the new attachment?
Do you need every account on the database to have that attachment linked to? Not a good idea if you ask me.
Sumant KSumant K
Good Questions Satish, I think they didn't say anything that but I guess its something like a group of accounts or every account on the database to have  that attachment linked to. I think on both scenarios are good to know please.