alertDialog and confirmDialog in CRM 2013

CRM 2013 have added 2 new methods alertDialog and confirmDialog. These new methods have been added by keeping Tablets in mind. Instead of using window.alert and window.confirm we need to use these two new methods to display message to the user. Xrm.Utility.alertDialog(message,onCloseCallback) Xrm.Utility.confirmDialog(message,yesCloseCallback,noCloseCallback)   Usage:-   Xrm.Utility.alertDialog(“Message on alert dialog”, function () { // Change…


Executing request messages in background (asynchronously) using ExecuteAsyncRequest in CRM 2013

CRM 2013 has introduced new request ExecuteAsyncRequest to execute the Request messages in async. This message can be used for resource intensive or long running requests in background. However right now only the ImportSolutionRequest message is the only message that is supported with the ExecuteAsync. Trying to run any another messages will result in exception…


Setting and retrieving Date Encryption key programmatically in CRM 2013

System admin can manage Data Encryption through Settings à Data Management à Data Encyrption area. To programmatically retrieve and update the Encryption key we can use the RetrieveDataEncryptionKeyRequest and SetDataEncryptionKeyRequest RetrieveDataEncryptionKeyRequest retrieveDataEncryptionKeyRequest = new RetrieveDataEncryptionKeyRequest(); IOrganizationService organizationService = RetrieveOrganizationService(); RetrieveDataEncryptionKeyResponse retrieveDataEncryptionKeyResponse = (RetrieveDataEncryptionKeyResponse)organizationService.Execute(retrieveDataEncryptionKeyRequest); MessageBox.Show(retrieveDataEncryptionKeyResponse.EncryptionKey);   SetDataEncryptionKeyRequest setDataEncryptionKeyRequest = new SetDataEncryptionKeyRequest(); setDataEncryptionKeyRequest.ChangeEncryptionKey = true; setDataEncryptionKeyRequest.EncryptionKey =…


setShowTime in CRM 2013 to show Time for DateTime Control

setShowTime method can be used to show time along with date for the DateTime control. Xrm.Page.getControl(arg).setShowTime(bool)   Xrm.Page.getControl(‘createdon’).setShowTime(true);     Cheers, Shraddha Dhingra


addPreSearch and addCustomFilter in CRM 2013

Using these new methods we can now easily filter the lookup in CRM 2013. Using addPreSearch we can specify a handler to PreSearch Event. Inside the handler we can specify our fetch xml query that can be used for filtering. The filter applied in the fetch xml will be combined with the any previously added…


Notifications in CRM 2013

Notifications is one of the features that is available now in CRM 2013. We used to implement it in an unsupported manner in CRM 2011. This is how we can set the notification using the setFormNotification method Xrm.Page.ui.setFormNotification(message, level, uniqueId);   Message – the message to be displayed. Level – ERROR, INFO, WARNING (will show…


Custom tooltips in CRM 2013

In CRM 2013, we now have OOB way to specify custom tool tips for the fields using the description text. The description appearing as Tool Tip To achieve the same in CRM 2011 we had to go the unsupported way. Check this post. Cheers, Shraddha Dhingra


getUserName new method in CRM 2013 to get the current logged in user’s name.

A new method getUserName method has been added in CRM 2013 form programming model. This method returns the name of the current user. Calling the above function in on load of the form This method is only available in the Updated Entities i.e.   Cheers, Shraddha Dhingra