Prevent firing of OnChange function after field is updated on server side

前端 未结 1 1429
北荒
北荒 2020-12-19 22:49

When I register an OnChange function to a field, it gets fired if the field is updated on a plugin on the server side (On Dynamics Crm 2015)

Can this behavior be pre

相关标签:
1条回答
  • 2020-12-19 23:26

    I believe this is what you are trying to get:
    1. When user makes change on this field, call the JavaScript on change function;
    2. When the record is saved, a plugin might change the value of the field as well;
    3. If the field value is altered by the plugin, skip the JavaScript function.

    If this is correct, I would try this way:
    Remove the onChange event from the field, instead check the field status in onSave event of the form.
    Use Xrm.Page.getAttribute("org_myfield").getIsDirty() to determine whether the user makes any change on the field. It only checks the changes on client side so it won't be affected by plugin.

    0 讨论(0)
提交回复
热议问题