1

I am trying to add phonecall activity for contact. I used following code to add activity, but I cannot see it in activity list.

var ContactId = guid; //Contact GUID

var trigger = new XrmServiceToolkit.Soap.BusinessEntity("phonecall");
trigger.attributes["subject"] = "Hello";
trigger.attributes["regardingobjectid"] =
                     { id: ContactId, logicalName: "Contact", type: "EntityReference" };

triggerId = XrmServiceToolkit.Soap.Create(trigger);

}

Kindly suggest if I am missing anything.

Pranit Kothari
  • 9,721
  • 10
  • 61
  • 137

1 Answers1

2

You need to pass in contact as the logicalName. This:

{ id: ContactId, logicalName: "Contact", type: "EntityReference" };

should be:

{ id: ContactId, logicalName: "contact", type: "EntityReference" };
Donal
  • 31,121
  • 10
  • 63
  • 72