Sourab Gupta
2010-04-30 19:11:01 UTC
Hi all i am getting a Generic SQl Error when i try to create the phone call
activity from plugin.
phonecall call = new phonecall();
// set the regarding
call.regardingobjectid = new Lookup();
call.regardingobjectid.type = EntityName.new_po.ToString();
call.regardingobjectid.Value = new Guid(poid.ToString());
activityparty to = new activityparty();
to.partyid = new Lookup();
to.partyid.type = EntityName.contact.ToString();
to.partyid.Value = new
Guid(so.new_contactid.Value.ToString());
call.to = new activityparty[] { to };
//owner
Owner owner = new Owner();
owner.type = EntityName.systemuser.ToString();
owner.Value = new Guid(userid.ToString());
call.ownerid = owner;
call.directioncode = new CrmBoolean();
call.directioncode.Value = false;
call.scheduledend = new CrmDateTime();
call.scheduledend =
ConvertToCRMDateTime(Convert.ToDateTime(so.new_datetime.Value).ToLocalTime());
//Create the phone call
TargetCreatePhoneCall target = new TargetCreatePhoneCall();
target.PhoneCall = call;
CreateRequest request = new CreateRequest();
request.Target = target;
CreateResponse response =
(CreateResponse)crmService.Execute(request);
activity from plugin.
phonecall call = new phonecall();
// set the regarding
call.regardingobjectid = new Lookup();
call.regardingobjectid.type = EntityName.new_po.ToString();
call.regardingobjectid.Value = new Guid(poid.ToString());
activityparty to = new activityparty();
to.partyid = new Lookup();
to.partyid.type = EntityName.contact.ToString();
to.partyid.Value = new
Guid(so.new_contactid.Value.ToString());
call.to = new activityparty[] { to };
//owner
Owner owner = new Owner();
owner.type = EntityName.systemuser.ToString();
owner.Value = new Guid(userid.ToString());
call.ownerid = owner;
call.directioncode = new CrmBoolean();
call.directioncode.Value = false;
call.scheduledend = new CrmDateTime();
call.scheduledend =
ConvertToCRMDateTime(Convert.ToDateTime(so.new_datetime.Value).ToLocalTime());
//Create the phone call
TargetCreatePhoneCall target = new TargetCreatePhoneCall();
target.PhoneCall = call;
CreateRequest request = new CreateRequest();
request.Target = target;
CreateResponse response =
(CreateResponse)crmService.Execute(request);