You need to sign in to do that
Don't have an account?

link notes from accounts to opportunities
I would like to be able to see notes that were created in Accounts in the same notes field when in opportunities and vice versa. If someone enters information into the opportunities section, I would like it to populate into the notes section in accounts; same with accounts to opportunities. Can someone please explain how to do this? Thank you!
- Create a After Insert trigger on ContentDocumentTrigger
- Get the existing ContentDocumentLinks for a note: When a note is created , Salesforce will insert 2 records in ContentDocumentLink. One is for the SharedObject and the other for the Owner. For example: If you add a note to Account then the sharing is given to Account and the user.
- Check the SharedObject type. Use the value of ContentDocumentLink.LinkedEntityId to findout the Object Type. If it is Account get the related Opportunities , if it is Opportunity then get the Related Account Id.
- Now share the Note with the related records by inserting records into ContentDocumentLink
Find the psuedo code to get an Idea