转 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!

时间: 2024-08-01 04:21:31

转 Dynamics CRM Alert and Notification JavaScript Methods的相关文章

Dynamices CRM JS 类库 神器 XrmServiceToolkit - A Microsoft Dynamics CRM 2011 & CRM 2013 JavaScript Library

XrmServiceToolkit - A Microsoft Dynamics CRM 2011 & CRM 2013 JavaScript Library http://xrmservicetoolkit.codeplex.com/documentation 特殊用法Create 和 Update { id: Id, logicalName: "new_entityname", type: "EntityReference" };       //Loo

Dynamics CRM OData 查询超过50条记录的数据(Retrieving More than 50 records using OData)

在通过ODdata方式获取CRM数据时,默认查询出来的results只有50条数据,可以通过JSON返回的Object中的"_next"属性作为URL循环获取直到该属性为空 示例代码如下: relatedAccounts = []; function onload() { var serverUrl = Xrm.Page.context.getServerUrl(); var oDataUri = serverUrl + "/xrmservices/2011/Organiza

Step-by-Step Guide to Portal Development for Microsoft Dynamics CRM - 摘自网络

The Challenge Oftentimes in the world of Dynamics CRM, the need arises for non-CRM users to gain access to CRM data. A common solution is the implementation of a web portal which allows these users to perform certain actions on applicable CRM data. M

Devlop Win 8 and Windows Phone App for Microsoft Dynamics CRM

Microsoft Dynamics CRM App for Windows Phone http://www.windowsphone.com/en-us/store/app/dynamics-crm/bdf6ad14-8ff3-4db1-a9d5-336c50ef13ee Microsoft Dynamics CRM App for Windows 8 http://apps.microsoft.com/windows/en-us/app/microsoft-dynamics-crm/937

Intellisense in Visual Studio for Microsoft Dynamics CRM 2016

Intellisense in Visual Studio for Microsoft Dynamics CRM 2016 posted by dynamicsnick on may 18, 2016 CRM 2016, Javascript / Comments Off on Intellisense in Visual Studio for Microsoft Dynamics CRM 2016 If you do much development in CRM and use visual

Dynamics CRM 2015 New Feature (4): Calculate Field & Rollup Field

Calculate Field & Rollup Field 可以说是2个比较给力的Feature,随着Dynamics CRM版本的不断更新,这样激动人心的feature可是一个接一个的冒出来.就Calculate Field和Rollup Field来说,之前实现这样的功能都需要开发人员参与,但是现在只需要简单的手工配置就可以简单完成. Calculate Field--故名思意,就是级联字段,通过多个字段的值计算并将结果赋值给最终字段,之前做这样的开发是离不开Javascript,并且更给

微软Dynamics crm 2013升级2015(一)提前准备及补丁

微软Dynamics crm 2013升级2015 之前,要把CRM 2013的补丁安装好,才能安装2015的安装包 主要要装以下的补丁: 1. kb2941390 2. kb2963850 3. kb3016464 kb2941390 kb2963850 kb3016464 安装完成了. 注:所有的安装程序在微软官方可以下载到.

微软Dynamics crm 2013升级2015(二)正式安装2015安装包升级

以下为2015版本的详细安装过程 出错了,不过重启一下,就可以下一步了. 注: 安装时电脑一定要联上互联网,否则安装不能成功的. 联网下载中 虽然有6个警告,不过是可以下一步的. 因为笔者的电脑性能不好,所有的应用都装在一台电脑上. 打开 开始 菜单 ------ Microsoft Dynamics CRM 部署管理器 . 可以看到版本为7.0开头,为2015版本:如果是6.0 ,那就是CRM 2013. 上图 关于CRM 对话框中所示,版本正式为 2015了.    

Dynamics CRM 2015 Update 1 系列(7): 消息事务 - ExecuteTransactionRequest

Dynamics CRM 2015 Update1 现在能将多个消息放在同一个事务管道里面执行了.这确实是个极好的Feature呀,这样我们可以灵活的组合不同的消息来实现复杂的业务需求而不用担心处理失败后的回滚细节. 使用方法也是非常的简单,调用ExecuteTransactionRequest消息,并将想要放入事务的消息放入该事务中,并提交至服务器,统一执行.我们看看下面的代码片段: ExecuteTransactionRequest req = new ExecuteTransactionR