繁体   English   中英

Dynamics CRM 2016内部部署禁用用户不起作用

[英]Dynamics CRM 2016 on-premise Disable a user does not work

我们已升级到内部部署的CRM 365(8.2.2),并且正在使用自定义代码来停用用户(将数据移至其他用户等)。 最后,我们使用以下示例代码: https : //docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/sample-disable-user但是在升级后,该代码不再对我们有用。

现在我们得到“ -1不是带有ID的邮箱上的有效状态代码”,然后查看服务器上的错误,如下所示:

[2018-09-17 08:07:45.297]进程:w3wp |组织:|线程:9 |类别:Platform.Sdk |用户:|级别:错误|要求ID:129694cd-1d73-4723-8d3e-ca9487294697 | ActivityId: ad01991a-c02a-4f1e-9db1-3a936a432752 | VersionedPluginProxyStepBase.Execute ilOffset = 0x64

Web服务插件在SdkMessageProcessingStepId中失败:{57CDBB1B-EA3E-DB11-86A7-000A3A5473E8}; EntityName:systemuser; 阶段:30; MessageName:SetStateDynamicEntity; AssemblyName:Microsoft.Crm.Extensibility.InternalOperationPlugin,Microsoft.Crm.ObjectModel,版本= 8.0.0.0,区域性=中性,PublicKeyToken = 31bf3856ad364e35; 类别名称:Microsoft.Crm.Extensibility.InternalOperationPlugin; 异常:未处理的异常:System.Reflection.TargetInvocationException:调用的目标引发了异常。 在System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj,Object []参数,Object []参数)在System.Reflection.RuntimeMethodInfo处System.RuntimeMethodHandle.InvokeMethod(对象目标,Object []参数,签名sig,布尔构造函数)。 Microsoft.Crm.Extensibility.InternalOperationPlugin.Execute上的System.Web.Services.Protocols.LogicalMethodInfo.Invoke(Object object,Object [] values)的Invoke(对象obj,BindingFlags invokeAttr,Binder活页夹,Object []参数,CultureInfo文化) Microsoft.Crm.Extensibility.V5PluginProxyStep.ExecuteInternal(PipelineExecutionContext上下文)的(IServiceProvider serviceProvider)Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext上下文)的内部异常:Microsoft.Crm.CrmArgumentException:-1不是有效的状态代码带ID的邮箱。 在Microsoft.Crm.BusinessEntities.BusinessProcessObject.SetState(BusinessEntityMoniker名字对象,Int32 newState,Int32 newStatusCode,BusinessContext原本上下文,执行) Microsoft.Crm.ObjectModel.MailboxServiceInternal处的Microsoft.Crm.BusinessEntities.BusinessProcessObject.SetState 1.SetState(BusinessEntityMoniker moniker, Int32 newState, Int32 newStatusCode, ExecutionContext context) at Microsoft.Crm.ObjectModel.SystemUserServiceInternal 1.SetMailboxState(BusinessEntityMoniker绰号,的Int32 newState,的Int32 newStatusCode,的ExecutionContext上下文)在Microsoft.Crm.ObjectModel.SystemUserServiceInternal`1.SetState(BusinessEntityMoniker绰号,的Int32 newState,的Int32 newStatusCode,的ExecutionContext上下文)在Microsoft.Cr m.ObjectModel.SystemUserService.Microsoft.Crm.Sdk.IStateful.SetStateStatus(BusinessEntityMoniker,Int32,Int32,ExecutionContext)内部异常:System.ArgumentException:-1不是具有ID的邮箱上的有效状态代码。 参数名称:stateCode

因此,我尝试先停用用户邮箱,但这无济于事。 还是一样的问题。 任何人都有相同的问题并以某种方式解决了吗?

尝试使用IOrganizationService.Update()方法更新状态码/状态码字段。

_service.Update(new SystemUser{ Id = <systemuserid>, StateCode= new OptionSetValue(1), StatusCode= new OptionSetValue(-1)});

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM