//Instantiate ‘Entity’ and set the ‘LogicalName’ to “annotation”

Entity objNotes = new Entity();
objNotes.LogicalName = “annotation”;

//Set ‘Subject’ and ‘notetext (i.e.,Body)’ properties
objNotes.Attributes.Add(“subject”, ”—-Your Subject—”);
objNotes.Attributes.Add(“notetext”, “—Your notes text—”);

//Relate the note with ‘Quote’ using ‘EntityReference’

EntityReference refQuote = new EntityReference();
refQuote.LogicalName = “quote”;
refQuote.Id = quoteID;  //Quote GUID
objNotes.Attributes.Add(“objectid”, refQuote);

//Set “objecttypecode” property with “quote” objecttypecode (i.e.,1084)

//Refer http://technet.microsoft.com/en-us/library/ms955729.aspx for objecttypecode’s
objNotes.Attributes.Add(“objecttypecode”, 1084);

//Call CRMService ‘Create’ method

crmService.Create(objNotes);

Advertisements
Advertisements

3 responses to “Adding “Notes” to the “Quote” progrmatically in CRM 2011”

  1. Rohit Avatar
    Rohit

    Thanks a ton, this was wat i was looking for….

    1. Rajeev Pentyala Avatar

      You are welcome Rohit…

  2. qBaB Avatar
    qBaB

    How to get quoteID and crmService object?

Leave a comment

Visitors

2,092,614 hits

Top Posts