Hi all,
I have to create phone call by silverlight application using Soap .I have create it but Value in To is not assign.
Entity entity = new Entity();
entity.LogicalName = "phonecall";
entity.Id = new Guid(); //if we will not pass, API will create
entity["subject"] = txtSubject.Text;
service.BeginCreate(entity, new AsyncCallback(CreateRecord), service);
void CreateRecord(IAsyncResult result)
{
Guid id = ((IOrganizationService)result.AsyncState).EndCreate(result);
Deployment.Current.Dispatcher.BeginInvoke(delegate { SetStateCode(id); });
}
void SetStateCode(Guid recordId)
{
Entity from = new Entity();
// from = new Entity();
from.LogicalName = "activityparty";
from["partyid"] = new EntityReference() { LogicalName = "contact", Id = new Guid("6A6964DA-1BAB-E211-BC1B-984BE173A3B9")
};
from["activityid"] = new EntityReference() { LogicalName = "phonecall", Id = recordId };
OptionSetValue osv = new OptionSetValue();
osv.Value = 1;//for "sender" field
from["participationtypemask"] = osv;
IOrganizationService service = SilverlightUtility.GetSoapService();
service.BeginCreate(from, new AsyncCallback(CreateToOrFrom), service);
}
Any Suggestion or link
Hope this helps. ----------------------------------------------------------------------- Santosh Bhagat If this post answers your question, please click "Mark As Answer" on the post and "Vote as Helpful"