Microsoft Dynamics CRM 2013: Client API Enhancement

Client API

Xrm.Page.data: The following methods have been introduced.

  • Xrm.Page.data.Refresh()This method allows you to refresh the data asynchronously without reloading the form.
  • Xrm.Page.data.Save().then(successCallback, errorCallback)This method allows you to save the record asynchronously with the option to set callback functions to be executed after the save operation is completed.
  • Xrm.Page.data.getIsValid()This method allows you to force the form validation, the return type is Boolean.
  •  Xrm.Page.data.setFormDirty()This methods allows you to set IsDirty options on the form to (true/false), to indicate if they are any changes made to the form since the last save.

Xrm.Page.data.entity: The following method have been introduced.

  •  Xrm.Page.data.entity.getPrimaryAttributeValue() This method returns a string of the primary attribute value.

Xrm.Page.context: The following methods have been introduced.

  • Xrm.Page.context.getClient()This method returns a value to indicate which client the script is executing in.
  • Xrm.Page.context.getClientState()This method allows you to get if the user is working online or offline.
  • Xrm.Page.context.getUserName()This method allows you to get the username of the currently logon user.

Xrm.Page.ui.controls: The following methods have been introduced.

  • Xrm.Page.ui.setFormNotification(Message,Type,UniqueId)This method allows you to display notifications on the form, based on the business logic. You can pass three parameters to the function, message, type of message and message unique name.
  • Type options:
    • ERROR
    • WARNING
    • INFO
  •  Xrm.Page.ui.clearFormNotification(UniqueId)This method allows you to clear the messages displayed on the form by the setFormNotification, you can pass the message unique name as a parameter to clear that specific message.
  • Xrm.Page.ui.controls.get(controlName).setNotification(Message,Type,UniqueId)This method allows you to display notifications on a control. It takes the same parameters as the form method.
  •  Xrm.Page.ui.controls.get(controlName).clearNotification(UniqueId)This method allows you to clear messages displayed on a control by the setFormNotification, you can pass the message unique name as a parameter to clear that specific control message.
  • Xrm.Page.ui.controls.get(controlName).setPrecision()This method allows you to overwrite precision set for that control.
  • Xrm.Page.ui.controls.get(controlName).setIsAllDay()This method allows you to set the date control to all day date time.
  • Xrm.Page.ui.controls.get(controlName).setShowTime(bool)This method allows you to specify whether a date control should show the time portion of the date.
  • Xrm.Page.ui.controls.get(controlName).addCustomFilter(filter,entityLogicaName)This method allows you to add additional filters to the results displayed in the lookup using fetchXml. Each filter will be combined with any previously added filters as an ‘AND’ condition.
  • Xrm.Page.ui.controls.get(controlName).addPreSearch(handler)This method allows you to add additional logic that will occur just before the search dialog box opens when you set a lookup value.
  • Xrm.Page.ui.controls.get(controlName).removePreSearch(handler)This method allows you to remove event handler functions that have previously been set for the PreSearch event. 

Xrm.Utility: The following methods have been added.

  • Xrm.Utility.openWebResourceDialog(webResourceName,webResourceData,width,height)  : This method allows you to open html web resource types as dialogs.
  • Xrm.Utility.alertDialog(message,onCloseCallback)This method allows you to displays a non-blocking alert dialog with a callback function.
  • Xrm.Utility.confirmDialog(message,yesCloseCallback,noCloseCallback)This method allows you to displays a non-blocking confirm dialog with different callbacks depending on the button clicked by the user.

Additional Information/Materials
http://www.youtube.com/watch?v=VqaggOt4jcc
http://www.microsoft.com/en-za/download/details.aspx?id=40321

Advertisements

One Response to Microsoft Dynamics CRM 2013: Client API Enhancement

  1. Pingback: CRM 2013 Client API: Save & Refresh « .NET'ers

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Workflow Elements by Aiden Kaskela

Business Solutions (CRM) MVP, Contractor, Evangelist

MSDYNAMICSBLOG BY DEEPESH

Real Experiences from Analyzing, Architecting, developing and working with Dynamics CRM, Dynamics 365 and sometimes .net

Mark Margolis's Blog

It's about Software, CRM, Product Development and sometimes Food.

GT // CRM

Gareth Tucker on Microsoft Dynamics CRM

Donna Edwards

Sharing my Journey with Dynamics 365

The WordPress.com Blog

The latest news on WordPress.com and the WordPress community.

%d bloggers like this: