Dynamics 365 Attach a Note to a Record with C#

3 Comments

To attach a note to to an entity using C#, use the code below. The note entity is “annotation”.

For example, you could attach a note to a case (incident):

string entitytype = "incident";
Entity Note = new Entity("annotation");
Guid EntityToAttachTo = Guid.Parse("FDA93807-4EF3-E711-80F2-3863BB2E34E8"); // The GUID of the incident
Note["objectid"] = new Microsoft.Xrm.Sdk.EntityReference(entitytype, EntityToAttachTo);
Note["objecttypecode"] = entitytype;
Note["subject"] = "Test Subject";
Note["notetext"] = "Test note text";
service.Create(Note);

This would create a note below on the case:

 

THANKS FOR READING. BEFORE YOU LEAVE, I NEED YOUR HELP.
 

I AM SPENDING MORE TIME THESE DAYS CREATING YOUTUBE VIDEOS TO HELP PEOPLE LEARN THE MICROSOFT POWER PLATFORM.

IF YOU WOULD LIKE TO SEE HOW I BUILD APPS, OR FIND SOMETHING USEFUL READING MY BLOG, I WOULD REALLY APPRECIATE YOU SUBSCRIBING TO MY YOUTUBE CHANNEL.

THANK YOU, AND LET'S KEEP LEARNING TOGETHER.

CARL

https://www.youtube.com/carldesouza

 

ABOUT CARL DE SOUZA

Carl de Souza is a developer and architect focusing on Microsoft Dynamics 365, Power BI, Azure, and AI.

carldesouza.comLinkedIn Twitter | YouTube

 

3 Responses to Dynamics 365 Attach a Note to a Record with C#

Leave a Reply

Your email address will not be published. Required fields are marked *