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.

 
  1. 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.

 
  1. function preventAutoSave(econtext) {
  2. var eventArgs = econtext.getEventArgs();
  3. if (eventArgs.getSaveMode() == 70 || eventArgs.getSaveMode() == 2) {
  4. eventArgs.preventDefault();
  5. }
  6. }

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.

 
  1. execObj.getEventArgs().isDefaultPrevented()
Return Value

Type: Boolean

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

 
  1. 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. org.springframework.orm.hibernate3.support.OpenSessionInViewFilter作用

    在Spring与Hibernate集成时在web.xml要加入这样的过滤器: <filter> <filter-name>openSessionInView</filte ...

  2. TKinter之菜单

    菜单的分类也较多,通常可以分为下拉菜单.弹出菜单. 1.使用Menu类创建一个菜单 2.add_command添加菜单项,如果该菜单是顶层菜单,则添加的菜单项依次向右添加. 如果该菜单时顶层菜单的一个 ...

  3. mysql 远程访问授权

    给mysql改了密码了,程序就不让登录了: mysql 网外链接 Access denied for user 这不能忍啊!咋办?授权呗! 命令行: GRANT ALL PRIVILEGES ON * ...

  4. 网站首页title 里显示ico图标

    有两种实现方式 图片尺寸大小 第一种:直接做一个favicon.ico 图标放在项目的根目录里就行 第二种:在网页HEAD标记中添加如下代码:<HEAD> <LINK REL=”SH ...

  5. junit类找不到的问题解决

    1. Class not found  *******java.lang.ClassNotFoundException: ******* at java.net.URLClassLoader$1.ru ...

  6. Spring 注解总结

    声明:这是转载的.内容根据网上资料整理.相关链接:http://www.360doc.com/content/10/1118/16/2371584_70449913.shtmlhttp://www.i ...

  7. 计算阶乘n!末尾0的个数

    一.问题描述 给定一个正整数n,请计算n的阶乘n!末尾所含有“0”的个数.例如: 5!=120,其末尾所含有的“0”的个数为1: 10!= 3628800,其末尾所含有的“0”的个数为2: 20!= ...

  8. Hibernate入门学习(一)

    一.Hibernate是什么 Hibernate主要用来实现Java对象和数据表之间的映射,除此之外还提供数据查询和获取数据的方法,可以大幅度减少开发时人工使用SQL和JDBC处理数据的时间.Hibe ...

  9. SQL 查看数据库表的容量大小

    --==============查看数据库表的容量大小========start================================?============ Create Table # ...

  10. jQuery网页右侧固定层显示隐藏在线qq客服代码

    CSS代码: @charset "utf-8"; ;;} html,body{font-size:12px;font-family:"微软雅黑";outline ...