Blog Archives

How to set form notification in CRM 2013 using JScript – CRM 2013 Feature

There is a new client API  feature introduced in CRM 2013 – Setting Form and Field level notifications through Jscript.

Let’s have a look at how to set the form notification on the Account form.

We will be using the new Xrm.page.ui.setFormNotitication() method to achieve this.

Xrm.Page.ui.setFormNotification(message, level, uniqueId);

Parameters

message | Type: String. The text of the message.

level | Type: String. The level of the message.

The level defines how the message will be displayed.

  • ERROR : Notification will use the system error icon.
  • WARNING : Notification will use the system warning icon.
  • INFO : Notification will use the system info icon.

uniqueId | Type: String. A unique identifier for the message used with clearFormNotification to remove the notification.

Sample Method which calls this method – registered on the OnSave() event of Account form

function AlertOnAccountForm() {
 Xrm.Page.ui.setFormNotification('Sample Error Notification message for Demo ', 'ERROR', '1');
 Xrm.Page.ui.setFormNotification('Sample information Notification message for Demo ', 'INFORMATION', '2');
 Xrm.Page.ui.setFormNotification('Sample Warning Notification message for Demo ', 'WARNING', '3'); }

And the form UI will be like this:

FormNotofication_screen

Read the rest of this entry

How to Hide a section in CRM 2011 using JavaScript?

//How to Show a section using JavaScript?
Xrm.Page.ui.tabs.get(tabNumber).sections.get(sectionNumber).setVisible(true);
//How to Hide a section using JavaScript?
Xrm.Page.ui.tabs.get(tabNumber).sections.get(sectionNumber).setVisible(false);
**For CRM 2011 Training, please check out our CRM Training page. Please share |Like in Facebook if you feel like this page is useful.

CRM 2011 JavaScript Objects – Layout and Controls Hierarch

This figure gives you an idea of how the JavaScript components are available in the hierarchy.

**For CRM 2011 Training, please check out our CRM Training page. Please share |Like in Facebook if you feel like this page is useful.

How to Debug JScript in Microsoft Dynamics CRM 2011?

//How to Debug JScript in Microsoft Dynamics CRM 2011?

Debugging in Jscript code can be done by adding the debugger: keyword to the code.
function DebugSample()
{
    alert(“Pop Up Message Before Debugging”);
    // debugger keyword will trigger the debug
    debugger;
    alert(“Pop Up Message After Debugging”);
}
**For CRM 2011 Training, please check out our CRM Training page. Please share |Like in Facebook if you feel like this page is useful.