hi all am trying to create note when account Creates using Plugin
i dont want to attach any files in Notes
just i want to trying a adding a text File.
when account Create Note Text File also Create
if (context.InputParameters.Contains("Target") && context.InputParameters["Target"] is Entity)
{
// Obtain the target entity from the input parameters.
Entity entity = (Entity)context.InputParameters["Target"];
// Verify that the target entity represents an account.
// If not, this plug-in was not registered correctly.
if (entity.LogicalName != "account")
return;
try
{
Entity _annotation = new Entity("annotation");
_annotation.Attributes["objectid"] = new EntityReference("account", new Guid("9ed7e828-fa70-e411-ba71-5453ed23c515"));
_annotation.Attributes["objecttypecode"] = "account";
_annotation.Attributes["mimetype"] = @"text/plain";
_annotation.Attributes["notetext"] = "Note is Created From Lead";
service.Create(_annotation);
}
Please Give me some Suggestion
*This post is locked for comments