I have written simple JavaScript code to add phonecall activity in dynamics CRM,
var ContactId = guidOfContact; //which is correct and working fine
var trigger = new XrmServiceToolkit.Soap.BusinessEntity("phonecall");
trigger.attributes["subject"] = "Test Call";
trigger.attributes["directioncode"] = false; //for Incoming
trigger.attributes["regardingobjectid"] = { id: ContactId, logicalName: "contact", type: "EntityReference" };
triggerId = XrmServiceToolkit.Soap.Create(trigger);
This code is working fine. But when I try to add 'to', and 'from' attribute like,
var partlistset = new Array();
partlistset[0] = new Object();
partlistset[0].id = ContactId; // provide a guid type value
partlistset[0].name = "Some Name"; // provide a suitable name
partlistset[0].entityType = "contact";
trigger.attributes["from"] = partlistset;
It just doesn't work. No activity is getting added to crm?
Kindly suggest what is wrong with my code.