Save event arguments (client-side reference)

 

Applies To: Dynamics CRM 2016, Dynamics CRM Online

In the save event you can use the execution context object getEventArgs method to retrieve an object that contains methods you can use to manage the save event.

getSaveMode

Returns a value indicating how the save event was initiated by the user.

isDefaultPrevented

Returns a value indicating whether the save event has been canceled because the preventDefault method was used in this event hander or a previous event handler.

preventDefault

Cancels the save operation, but all remaining handlers for the event will still be executed.

Returns a value indicating how the save event was initiated by the user.

 
execObj.getEventArgs().getSaveMode()
Return Value

Type: Number

The following table describes the supported values returned to detect different ways entity records may be saved by the user.

Entity

Event Mode

Value

All

Save

1

All

Save and Close

2

All

Save and New

59

All

AutoSave

70

Activities

Save as Completed

58

All

Deactivate

5

All

Reactivate

6

User or Team owned entities

Assign

47

Email (E-mail)

Send

7

Lead

Qualify

16

Lead

Disqualify

15

Remarks

This method is essential if you want to enable auto-save for most forms in an organization but disable it for specific forms. The following code registered for the onSave event with the execution context passed to it will prevent any saves that initiate from an auto-save but allow all others. With auto-save enabled, navigating away is equivalent to Save and Close. This code will prevent any saves that are initiated by the 30 second timer or when people navigate away from a form with unsaved data.

 
function preventAutoSave(econtext) {
var eventArgs = econtext.getEventArgs();
if (eventArgs.getSaveMode() == 70 || eventArgs.getSaveMode() == 2) {
eventArgs.preventDefault();
}
}

To save a record the user must click the Save  icon at the bottom of the form or a custom Save command needs to be added to the command bar.

在需要设置的Form的窗体的OnSave事件添加上面的函数,同时勾上[将执行上下文作为第一个参数传递]这个选项即可.

Returns a value indicating whether the save event has been canceled because the preventDefault method was used in this event hander or a previous event handler.

 
execObj.getEventArgs().isDefaultPrevented()
Return Value

Type: Boolean

Cancels the save operation, but all remaining handlers for the event will still be executed.

 
execObj.getEventArgs().preventDefault()

CRM 2016 自动保存 Save event arguments的更多相关文章

  1. 关于Microsoft CRM 2013自动保存Autosave功能的10点说明

    今天不经意翻看到以前记的笔记发现这个笔记觉得还是应该把它整理记录一下: 关于Microsoft CRM 2013自动保存Autosave功能的10点说明: 1.新建时不会自动保存,需要手动点击保存按钮 ...

  2. CRM 2013 系统设置新功能一:界面自动保存 及 SDK 中 Xrm.Page.data.entity.save

    CRM 2013 界面会自动保存了..在系统设置中默认“是”,如果不需要可以调整. CRM实体记录在新建时会有出现“保存”按钮,非新建状态下,没有“保存”按钮只有“新建”按钮,系统将会自动为你保存最后 ...

  3. Dynamics CRM 2016 的新特性

    新版本CRM (2016 with update 0.1) 发布已有几个月了,总结一下新特性,从几个方面来看: 1. 针对整合功能的新特性 (1) 增加了CRM App for Outlook. 这个 ...

  4. CRM 2016 升级CRM365之注意事项

    https://docs.microsoft.com/zh-cn/previous-versions/dynamicscrm-2016/deployment-administrators-guide/ ...

  5. 在VM虚拟机上安装Microsoft Dynamics CRM 2016 步骤图解及安装注意事项

    安装Dynamics CRM 2016环境配置要求: 系统版本:Windows Server 2012 R2(必须) SQL 版本: SQLServer2014SP1-FullSlipstream-x ...

  6. Phpstorm 设置取消自动保存

    个人通过使用,发现PhpStorm的确是 编辑PHP 的神器,提供用户效率,提供智能代码补全,快速导航以及即时错误检查. 不过,让我用起来不爽的是,它会自动保存,还不能使用快捷键Ctr+Z来撤销,也就 ...

  7. Office——EXCEL 打开自动修改 关闭自动保存

    ==================================声明================================== 本文版权归作者所有 未经作者授权 请勿转载 保留法律追究的 ...

  8. C#实体图片下载与批量下载(自动保存功能)

    新工作,第一个小任务,制作一个点击下载图片的功能.并提供批量下载操作.图片是字节流的形式,存放在数据库中的. 为了避免直接从数据库中,下载失败,会在本地保存一份. 进行压缩的是SharpZip这个压缩 ...

  9. phpstorm取消自动保存,修改快捷键并标识修改的文件为星星标记

    编辑时间: 2016-8-3 15:15:37 个人通过使用,发现PhpStorm的确是 编辑PHP 的神器,提供用户效率,提供智能代码补全,快速导航以及即时错误检查. 不过,让我用起来不爽的是,它会 ...

随机推荐

  1. 关于IE10出现LinkButton点击无效的解决方案

    关于IE10出现LinkButton点击无效的情况: 一般高配置的系统如Win7旗舰版SP1系统不会出现这种情况,针对家庭普通版和专业版的用户通过测试都有这种情况,对于开发人员要解决不同系统和IE的兼 ...

  2. OpenJudge计算概论-求一元二次方程的根【含复数根的计算、浮点数与0的大小比较】

    /*====================================================================== 求一元二次方程的根 总时间限制: 1000ms 内存限 ...

  3. 必须Mark!43个优秀的Swift开源项目推荐

    摘要:拥有着苹果先天生态优势的Swift自发布以来,各种优秀的开源项目便层出不穷.本文作者站在个人的角度,将2014年Swift开源项目做了一个甄别.筛选,从工具.存储.网络.界面.框架到Demo以及 ...

  4. Blitz Templates介绍

    Blitz Templates Blitz Templates-应用于大型互联网项目的非常强大非常快的模板引擎.   下载: sourceforge, 源代码 主页, win32 二进制文件, 其他语 ...

  5. .net平台的RSA实现以及与Delphi之间的互操作性

    .net平台下面的RSA算法实现是RSACryptoServiceProvider,如果安装了 Microsoft Enhanced Cryptographic Provider,则 RSACrypt ...

  6. DB2 组内分组排序,游标使用

    CREATE PROCEDURE Sys_Init_tblaccountsuser_sortid () P1: BEGIN '; ; ; ; DECLARE CUR1 CURSOR WITH RETU ...

  7. Android外派(安卓外派) — 长年提供安卓开发工程师外派业务(可签合同)

    北京动点飞扬长年提供安卓工程师外派业务. 平均技术情况如下: 1.2~3年以上Android平台开发经验2.熟练掌握java技术,熟悉面向对象编程设计3.熟悉Android应用开发框架及Activit ...

  8. php 获取中文的拼音

    注意事项: 无法识别的中文 亳:bo,如果有此字,结果为空,调用此类之前需要手动加判断 蚌:bang,beng,多音字 莞:guan 圳:zhen 儋:dan 漯:luo 濮:pu 泸:lu 衢:qu ...

  9. 战胜忧虑<2>——忙碌可以消除忧虑

    忙碌可以消除忧虑 当你的脑筋空出来时,也会有东西进去补充,是什么呢?通常都是你的感觉.为什么?因为忧虑.恐惧.憎恨.嫉妒.和羡慕等等情绪,都是由我们的思想所控制的,这种情绪都非常猛烈.会把我们思想中所 ...

  10. NOR Flash擦写和原理分析 (二)

    Nor Flash上电后处于数据读取状态(Reading Array Data).此状态可以进行正常的读.这和读取SDRAM/SRAM/ROM一样.(要是不一样的话,芯片上电后如何从NorFlash中 ...