Skip to main content



No record found.

Microsoft Dynamics CRM forum

Automatically create a Note on a Contact record when it is saved

Posted on by 34
I'm hoping someone can help me with what I hope is a quick javascript!  I basic want whether a new Contact is created to use the On Save event to add a note to the record.  Just a simple note like "Contact created" would suffice! 
And if I did set up this event, does it work also during bulk imports?
  • Verified answer
    Leah Ju Profile Picture
    Leah Ju Microsoft Employee on at
    Automatically create a Note on a Contact record when it is saved
    You need create note record through web API:
    My example code:
    function createNote(executionContext) {
         var formContext = executionContext.getFormContext();
         var contactID ="{","").replace("}","");//current contact GUID

         var record = {};
         record["objectid_contact@odata.bind"] = "/contacts("+ contactID +")"; // Regarding
         record.subject = "Contact created"; // Text

         Xrm.WebApi.createRecord("annotation", record).then(
              function success(result) {
                   var newId =;
              function (error) {

    Test Result:

    I hope you can mark my answer verified if it answer your question! If you have any questions, please feel free to contact me.

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .


André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,773 Super User

Martin Dráb Profile Picture

Martin Dráb 225,513 Super User

nmaenpaa Profile Picture

nmaenpaa 101,148


Featured topics

Product updates

Dynamics 365 release plans