积极答复者
修改任务状态问题

问题
-
在plug-in中修改任务的状态(修改成完成状态)。
代码:
SetStateTaskRequest state = new SetStateTaskRequest();
state.TaskState = TaskState.Completed;
state.TaskStatus = 5;
state.EntityId = taskid;
SetStateTaskResponse stateSet = new SetStateTaskResponse();
stateSet = (SetStateTaskResponse)crmService.Execute(state);
这段代码执行不过去报表。
这是什么原因啊?代码有错吗?还有其它要注意的地方吗?
谢谢!!!!
水杯
答案
-
你要检查一下当前的状态吧?
报什么错误啊?
你的代码看起来没什么问题啊.
// Create the Request Object
SetStateAccountRequest state = new SetStateAccountRequest();// Set the Request Object's Properties
state.AccountState = AccountState.Inactive;
state.AccountStatus = 2;// EntityId is the Guid of the account whose state is being changed
// SDK:state.EntityId = new Guid("AD618DB2-F0DB-4A6A-8C4B-2F2213EAA38E");;
state.EntityId = created.id;
// Execute the Request
SetStateAccountResponse stateSet = (SetStateAccountResponse)service.Execute(state);- 已标记为答案 Batistuta CaiModerator 2009年6月30日 3:28
-
try
{
SetStateAccountResponse stateSet = (SetStateAccountResponse)service.Execute(state);
}
catch(System.Web.Services.Protocols.SoapException ex)
{
throw new InvalidPluginExecutionException(ex.Message + ". " + ex.Detail.InnerText);
}
看看错误信息是什么
Batistuta Cai-刀客 | 蔡敏生 | MS CRM MVP | Blog:http://caims.cnblogs.com- 已标记为答案 Batistuta CaiModerator 2009年6月30日 3:28
全部回复
-
你要检查一下当前的状态吧?
报什么错误啊?
你的代码看起来没什么问题啊.
// Create the Request Object
SetStateAccountRequest state = new SetStateAccountRequest();// Set the Request Object's Properties
state.AccountState = AccountState.Inactive;
state.AccountStatus = 2;// EntityId is the Guid of the account whose state is being changed
// SDK:state.EntityId = new Guid("AD618DB2-F0DB-4A6A-8C4B-2F2213EAA38E");;
state.EntityId = created.id;
// Execute the Request
SetStateAccountResponse stateSet = (SetStateAccountResponse)service.Execute(state);- 已标记为答案 Batistuta CaiModerator 2009年6月30日 3:28
-
try
{
SetStateAccountResponse stateSet = (SetStateAccountResponse)service.Execute(state);
}
catch(System.Web.Services.Protocols.SoapException ex)
{
throw new InvalidPluginExecutionException(ex.Message + ". " + ex.Detail.InnerText);
}
看看错误信息是什么
Batistuta Cai-刀客 | 蔡敏生 | MS CRM MVP | Blog:http://caims.cnblogs.com- 已标记为答案 Batistuta CaiModerator 2009年6月30日 3:28