web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

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

(1) ShareShare
ReportReport
Posted on by 34
Hello!
 
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?
 
I have the same question (0)
  • Verified answer
    Leah Ju Profile Picture
    Microsoft Employee on at
    Hi,
    You need create note record through web API:
    My example code:
    function createNote(executionContext) {
         var formContext = executionContext.getFormContext();
         var contactID = formContext.data.entity.getId().replace("{","").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 = result.id;
                   console.log(newId);
              },
              function (error) {
                   console.log(error.message);
              }
         );
    }


    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.
    Regards,
    Leah
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 69 Most Valuable Professional

#2
ManoVerse Profile Picture

ManoVerse 55 Super User 2026 Season 1

#3
11manish Profile Picture

11manish 37

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans