【问题标题】:CRM 2015 update - plugin error - 'Changing security attributes is not allowed in stage 20 plugins'CRM 2015 更新 - 插件错误 - “在第 20 阶段插件中不允许更改安全属性”
【发布时间】:2016-04-22 16:41:04
【问题描述】:

当我尝试在更新后插件阶段创建另一种类型的实体记录时,我收到“在第 20 阶段插件中不允许更改安全属性”错误。 它在 Dynamics CRM 2013 SP1 CRM 中运行良好。 将 CRM 2013 更新到 CRM 2015 后,出现此错误

【问题讨论】:

    标签: dynamics-crm-2013 dynamics-crm-2015


    【解决方案1】:

    从预创建中删除逻辑并将其移动到其他实体的创建后。然后它会正常工作

    【讨论】:

      【解决方案2】:

      从插件图像中删除不需要的属性。仅选择插件中需要的属性。您可以在注册插件时设置它(不要勾选所有属性复选框)。删除安全相关属性(所有者,修改者,创建开)

      【讨论】:

        【解决方案3】:

        当组织迁移到 CRM 2015 时,有些人可能会在插件步骤中遇到此错误。 原因:

        • 您在记录预创建中更改记录的所有权

        分辨率:

        示例代码:

        //Runs on the Pre-Validation step, when a Contact is created
        if (context.Stage == 10)
        {
            if (!targetEntity.Attributes.Contains("parentcustomerid"))
            {
                throw new InvalidPluginExecutionException("Message to show....");
            }
            try
            {
                var accountOwner = (from a in orgServiceContext.AccountSet
                                where a.Id == targetContact.ParentCustomerId.Id
                                        select a).Single();
                    targetEntity.Attributes["ownerid"] = new EntityReference("team", accountOwner.OwnerId.Id);
                    targetEntity.Attributes["owningbusinessunit"] = new EntityReference("businessunit", accountOwner.OwningBusinessUnit.Id);
                    }
                    catch
                    {
                        throw new InvalidPluginExecutionException("Message to show...");
                    }
                }
        

        找到另一个解决方案:将您的插件步骤移至预验证。

        【讨论】:

        • 在创建时进行预验证对我有用。值得注意的是,这在更新期间的任何 pre-* 阶段都可以正常工作。
        猜你喜欢
        • 1970-01-01
        • 2011-09-30
        • 1970-01-01
        • 2013-03-16
        • 1970-01-01
        • 1970-01-01
        • 2020-02-07
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多