首页 > 解决方案 > Dynamics CRM v9.0 getIsDirty 不提供刷新值

问题描述

我正在使用动态 CRM 版本

9.1.0.4435 在线

. 我formContext.data.entity.getIsDirty()在保存事件中使用时遇到问题。

在低于9.0的CRM 版本中,Xrm.Page.data.entity.getIsDirty()根据字段的一个最新状态为我们提供了价值,如果我每分钟都调用此方法,它运行良好。

但是在 v9.0 中它被替换为formContext.data.entity.getIsDirty(),即使存在脏字段,它也没有给我等于 TRUE 的值。有谁知道解决方法或知道这种行为的任何原因?

标签: dynamics-365

解决方案


我只是试图在我的 OnSave 事件实例上复制您的问题。

我的 CRM 版本:版本 1710 (9.1.0.4435) 在线

我尝试并为我工作的东西。

function testFunction(executionContext){

    var formcontext = executionContext.getFormContext(); // gives me formcontext

    formcontext.data.getIsDirty() // returns True for me when form is dirty

    formcontext.getAttribute("caseorigincode").getIsDirty() // return true when this field is changes

    formcontext.getAttribute("emailaddress").getIsDirty() // returns false as this field was not changed.

    formcontext.data.entity.getIsDirty() // even this function returns true as form is dirty
}

推荐阅读