+ Start a Discussion
Phuc Nguyen 18Phuc Nguyen 18 

Need to share content in 2 locations

Hello All,
Looking for ieas on how to have an uploaded file in 2 locations.
So I am going to upload a file on a related record.  During upload there will be a picklist with set vlaues.  Thes evalues will have teh same name of other related records on teh same parent.  I was thinking :
  • Could  the file be uploaded and moved to the new location and then place a hyperlink on teh original record as a placeholder. 
Is that a good approach and is it even feasible?  Open to other ideas.  So need to be able to 1 file uploaded but accessible in 2 locations.

Thanks,
P
AnudeepAnudeep (Salesforce Developers) 
We can create multiple records of ContentDocumentLink to share a file across multiple records (Opportunities,Accounts,Users,etc…). You should write a trigger on ContentDocumentLink to achieve that

I recommend looking at this blog post for sample code
Phuc Nguyen 18Phuc Nguyen 18
Anudeep, thank you for the link.  Do you think I can use the same logic in that trigger and apply it to a trigger handler class?   Trying to keep 1 trigger per object.
Thanks
P