转 Dynamics CRM Alert and Notification JavaScript Methods
http://www.powerobjects.com/2015/09/23/dynamics-crm-alert-and-notification-javascript-methods/
Before CRM 2013, if you wanted to alert a user on a form within the browser, the only method available was the standard JavaScript alert. This method would open an alert window over the record the user is viewing, which then must be acknowledged in order for the user to continue.
The code,
alert("This is a standard alert")
produces the pop up window as illustrated below.

With CRM 2013, Microsoft introduced an additional alert method that is specific to CRM, Xrm.Page.ui.setFormNotification. This newer method allows you to specify three different types of alerts: error, information, and warning. Furthermore, instead of popping a window open over the current window, setFormNotification embeds the notification in the CRM page itself. These codes:
Xrm.Page.ui.setFormNotification("This is an INFORMATION notification.", "INFORMATION")
Xrm.Page.ui.setFormNotification("This is a WARNING notification. ", "WARNING")
Xrm.Page.ui.setFormNotification("This is an ERROR notification. ", "EROR")
produce the notifications in the screenshot below that are visible just under the Account record title.

The code
Xrm.Page.ui.clearFormNotification()
can be used to clear these notifications.
Additionally, you can call out specific fields with the setNotification method. The code
Xrm.Page.getControl("fax").setNotification("This is a notification about the Fax field")
produces the notification attached to the fax field on the Account record shown below.

With these different methods, you can now carefully choose how overt or subtle you would like to be in calling out important information on a record to users.
Want to stay up to date with our blog? Subscribe today!
Happy CRM’ing!
转 Dynamics CRM Alert and Notification JavaScript Methods的更多相关文章
- Dynamics CRM 2011/2013 通过Javascript给lookup字段赋值
仅仅做下记录,因为老是用到但老是忘记 var value = new Array(); value[0] = new Object(); value[0].id = idValue; value[0] ...
- 转:JavaScript Reference for Microsoft Dynamics CRM 2011 / 2013
JavaScript Reference for Microsoft Dynamics CRM 2011 / 2013 98 Replies Here’s a quick reference guid ...
- Dynamics CRM - 为 Form 或者字段设置 Error Notification
在 Dynamics CRM 开发中,我们一般要利用 JS 来做一些数据验证的功能,我们也需要将验证结果显示出来,比起直接 alert 出信息来提示用户的方式,CRM 提供了更加美观和人性化的方式来通 ...
- Dynamices CRM JS 类库 神器 XrmServiceToolkit - A Microsoft Dynamics CRM 2011 & CRM 2013 JavaScript Library
XrmServiceToolkit - A Microsoft Dynamics CRM 2011 & CRM 2013 JavaScript Library http://xrmservic ...
- 在Dynamics CRM中使用Bootstrap
我是微软Dynamics 365 & Power Platform方面的工程师罗勇,也是2015年7月到2018年6月连续三年Dynamics CRM/Business Solutions方面 ...
- Dynamics CRM 客户端程序开发:在实体的列表界面添加按钮
关注本人微信和易信公众号: 微软动态CRM专家罗勇 ,回复114或者20140312可方便获取本文,同时可以在第一时间得到我发布的最新的博文信息,follow me! 如果没有安装Ribbon Wor ...
- 为Dynamics CRM的Office附件注释定制个无需下载即可在线查看的功能
关注本人微信和易信公众号: 微软动态CRM专家罗勇 ,回复164或者20151021可方便获取本文,同时可以在第一时间得到我发布的最新的博文信息,follow me! 上一篇博客:为Dynamics ...
- 为Dynamics CRM注释的图片附件做个预览功能
关注本人微信和易信公众号: 微软动态CRM专家罗勇 ,回复163或者20151017可方便获取本文,同时可以在第一时间得到我发布的最新的博文信息,follow me! Dynamics CRM中注释可 ...
- 在Dynamics CRM中自定义一个通用的查看编辑注释页面
关注本人微信和易信公众号: 微软动态CRM专家罗勇 ,回复162或者20151016可方便获取本文,同时可以在第一时间得到我发布的最新的博文信息,follow me! 注释在CRM中的显示是比较特别, ...
随机推荐
- PPP 转义字符 编码 和 解码
#include <stdio.h> #include <string.h> // PPP数据帧每一帧都以标识字符0x7E开始和结束: // 由于标识字符的值是0x7E,因此当 ...
- 几个linux终端的有趣玩法
1.sl 还可以给别人搞恶作剧: alias ls=sl 这样别人使用 ls 列出目录和文件的时候,却出现一个小火车,那滋味一定很酸爽哈哈哈哈! 2. fortune 这个命令会随机输出有趣的话,比如 ...
- JavaScript 获取数组中最大值、最小值
笨方法 Array.prototype.max = function() { var max = this[0]; var len = this.length; for (var i = 1; i & ...
- JSP-JSTL学习
<%@page import="com.Student"%> <%@page import="com.Person"%> <%@p ...
- 点击input框,不让手机软键盘弹出的办法
设置readonly="" <input type="text" readonly="" placeholder="请输入邮 ...
- ListView只允许展开其中一个item的方法
xml文件代码: <?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:an ...
- the difference between const int *, int * const, int const *
Some people may be confused about the sequence of const and * on declaration in C++/C, me too. Now I ...
- hdu1260 dp
题意:有 k 个人需要买电影票,a[i] 表示第 i 个人单独买票要花费的时间,b[i] 表示第 i-1 个和第 i 个人一起买票需要花费的时间,问卖给所有人各一张票最少需要到什么时候. dp[i]表 ...
- POJ 3311 Hie with the Pie (状压DP)
dp[i][j][k] i代表此层用的状态序号 j上一层用的状态序号 k是层数&1(滚动数组) 标准流程 先预处理出所有合法数据存在status里 然后独立处理第一层 然后根据前一层的max推 ...
- Android AsyncTask 简单用法
简介 AsyncTask 是一个轻量级的异步处理类.使用是需继承自该类.可以方便的执行异步任务并且在将进度显示在UI上. 注意事项 AsyncTask只适合处理轻量级的任务即耗时几秒或者几十秒的任务. ...