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
Ricki ReayRicki Reay 

Stuck! Need Help! Triggering an auto-generated note (using enhanced notes) on the Account object when a Lead and Referral record is created and related to the account?

Hi everyone,

I have been working on this for the past week or so and have made absolutely no headway, despite trying to follow some other similar posts on this forum and the SF community forums. Here is the situation:

The org. I am working in uses the Financial Services Cloud managed package. With this package, the Lead object is renamed to "Leads and Referrals" and each of these records have the ability to be linked to an existing account record through a custom Lookup(Account) field titled "Related Account". The business requirement I am trying to fulfill is for a note to be generated on the existing account record everytime a new Lead and Referral record is created that is linked to the existing account. I am able to do it no problem if the Enhanced Notes are not enabled, but the org. I am working with is very active in using Enhanced Notes and do not want to take away that functionality.

Can anyone help me with creating a trigger or flow that would allow for me to create a new ContentNote record and link it to the existing account upon the creation of a related Lead and Referral reccord?

Thank you in advance. I really want to get this figured out - so any and all advice is greatly, greatly appreciated.

Look forward to hearing all of yours' insights!

ShirishaShirisha (Salesforce Developers) 
Hi Ricki,


Can you please check the below document for the sample trigger code to create the ContentNote as per your logic.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

Warm Regards,
Shirisha Pathuri