确定JavaScript保存事件中新记录所有者的值

时间:2014-10-21 09:35:31

标签: dynamics-crm-2013

我们对Case有安全要求,以便在用户通过OOB分配按钮选择新的所有者后,我们要求确认仅在新选择的所有者是用户时继续。

因此,我需要在保存/分配记录之前用JavaScript提示用户。使用事件上下文,我可以确定保存事件是否由所有权更改触发,但我无法确定是否确定了新所有者的值。

我在保存案例时触发了以下JavaScript事件......

if (ctx.getEventArgs().getSaveMode() == 47) {
    //I need to access the new owner here to check if it's a user
    Xrm.Page.getAttribute('ownerid').getValue() // <-- This is still the current owner
    Xrm.Utility.confirmDialog(user_assignment_prompt,
        function () { }, //Yes
        function () { ctx.getEventArgs().preventDefault(); }); //No
}

我不想覆盖Case上的Assign按钮,因为我们必须复制赋值对话框功能。

0 个答案:

没有答案