Adding “Notes” to the “Quote” progrmatically in CRM 2011
//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);
Thanks a ton, this was wat i was looking for….
You are welcome Rohit…
How to get quoteID and crmService object?