首页 > 其他 > 详细

Dynamics 365/CRM 保存之后触发onchange

时间:2017-09-24 11:19:51      阅读:375      评论:0      收藏:0      [点我收藏+]

有时候一些开发人员可能会遇到这样的问题而不知道其原因:

在一个字段注册了onchange事件之后,保存表单,发现onchange 又再次触发了一遍。

或者,在Ribbon 中使用

Xrm.Page.data.save(saveOptions).then(successCallback, errorCallback)

在successCallback,errorCallback中均没有调用字段的fireOnchange,然而字段的onchange又被触发了。

原因是CRM 在刷新页面数据时,会比较字段保存之前及保存之后的值,如果在保存之前没有改变字段值,在保存中使用插件修改了字段值,

CRM 在做字段值比较时会发现保存前后不一致,从而触发字段的onchange事件,保证onchange 事件会被正确执行。

在SDK 有明确的说明:

Field OnChange event


The OnChange event usually occurs when the data in a form field has changed and focus is lost. 

This event also occurs when data changes on the server are retrieved to update a field when the form is refreshed, such as after a record is saved.



Dynamics 365/CRM 保存之后触发onchange

原文:http://www.cnblogs.com/tcli/p/7586524.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!