|
<div id="cnblogs_post_body">statecode和statuscode是一对好基友,想直接通过修改statecode的值来激活或者停用一条记录,系统会报错
正确的方法应该是通过调用SetStateRequest来执行状态的改变
SetStateRequest setStateReq = new SetStateRequest();
setStateReq.EntityMoniker = new EntityReference(entityName, guid);
setStateReq.State = new OptionSetValue(statecode);
setStateReq.Status = new OptionSetValue(statuscode);
SetStateResponse setStateResp = (SetStateResponse)organizationService.Execute(setStateReq); |
|