Monday, September 17, 2018

Change Field Color in MS CRM 365


We recently upgraded one of our MS CRM 2011 application to MS CRM 365 and did found that whatever script we have written to change the field color it’s not working.

The reason behind this is we have switched off Legacy Rendering off and the forms are getting render using the new Turbo Form Rendering engine.

Here is the simple workaround we did found to field color change to be working-

1. First of all get the field element using parent.document.getElementById() method because document.getElementById() does not work here with new rendering engine.

    var scandoc = parent.document.getElementById("scanneddocumentpath");

After getting the field element object successfully set the zeroth element style properties as shown below-

   scandoc.children[0].style.color = 'blue';
   scandoc.children[0].style.textDecoration = "underline";


Here zeroth element is nothing but a "ms-crm-Inline-Value" css class applied to your text box and we are setting just a property of it using the above method.

That's it, it will change the color of your text field and you don't need to enable Legacy Rendering option.



Expected out of the field look like as shown in below screenshot of the form-




Friday, September 14, 2018

If multiple plug ins are registered with same execution order for same entity in which order they will get execute?


While registering the plug in we have to provide the execution order if multiple plugins are register for the same entity, what happens when the there are multiple plugins are registered for particular entity and the execution order is 1 for all of them? 

Well this is the information I found with Microsoft documentation of plug in- 


Specifies the order, also known as rank, that plug-ins are executed within a pipeline stage. Plug-ins registered with an order value of 1 are executed first, followed by plug-ins registered with an order of 2, and so on. However, if there is more than one plug-in in a stage with the same order value, then the plug-in with the earliest compilation date is called first.

Reference: 

https://docs.microsoft.com/en-us/previous-versions/dynamics-crm2011/developer-articles/hh237515(v=crm.6)#bkmk_RegStep



Thursday, September 13, 2018

Multi-Select Option Set in MS CRM




Finally, Microsoft has introduced a most awaited feature in Dynamics CRM 365 (Version 9) which provides ability to user to select multiple options from the drop down i.e. Multi-select Option Set.

While working with these type of requirement in previous versions of the MS CRM we have to achieve using customization. But now it is the part of out of the box functionalities.

Below are few points about the Multi Select OptionSets-
  • Multi-select Option Sets are a new attribute type
  • They are available on the Unified Interface as well as the Web Client
  • They are available for Main Forms, Quick Create Forms, and Quick View Forms.
  • They are not supported on legacy forms (i.e. mobile form)
  • They support all client APIs such as set attributes and controls, and will return an array instead of a single value.
So let’s understand here how we can use Multi select option in new version-
  1. Open your Form Designer
  2. Create a New Field
  3.  Provide the required details like Display Name and Name of the field as well as Field Requirement.
  4. Now to make it Multi Select, select the Data Type as “Multi Select Option Set
  5. Then add the appropriate options with proper label in the Option area as shown in below screen shot, here I have added options as provided document type like, Driving License, Phone bill etc. After filling all information click on Save and Close. 





Add the respective field on your form and that’s it, now you will able be able to use the Multi select Option set field , see below picture where I have selected multiple value from the drop down.



You can also add the column in a system view and it will show the values in view as shown in below format-



With the below URL you can find the more information like how we can deal pro-grammatically with the Multi-Select Option Set-


Wednesday, September 12, 2018

IME Mode in MSCRM while creating new attribute



When you create a new attribute for a Microsoft Dynamics CRM entity and have to set the characteristics like data type, min-max values and schema name, you would have seen a property called IMEmode, I always use leave this with default setting i.e. auto as shown in the below screenshot-


What exactly the use this setting, we definitely should know the intention of each and every property while working with MS CRM and very careful while creating new Entity and the Attributes for it.

So let’s understand for what exactly the property we have to set.

This option occurs with Single Line of Text, Multiple Lines of Text and other attributes that are bound to input elements or text area element.

IME stands for Input Method Editor and it lets you to enter and edit Chinese, Japanese, and Korean characters. These Asian writing systems have more characters than can be encoded for a regular keyboard. The IMEs for these languages use sequences of base characters that describe an individual character or group of characters to enter a larger set of characters.

Base characters can be component letters from Hangul syllables, phonetic components for Japanese kanji characters, or various combinations for Chinese characters. We can use the IME mode option to quickly enter these characters and symbols into text boxes, avoiding the manual switch to IME mode that would otherwise be required.
Input Method Editors have two principle states, inactive and active. The inactive mode behaves like a regular keyboard and uses a limited set of characters. The active mode accepts Chinese, Japanese, or Korean characters.

The following IME modes are available:



·     auto (default) - The IME mode is not affected with this choice.
·     active - All characters are entered in the IME mode, but you can still deactivate it. For name-related fields and addresses, the default is active for detailed forms.
·     Inactive - All characters are entered without using the IME mode, but you can still activate it. For datetime type fields, the default is inactive for detailed forms.
·     Disabled - The IME mode is disabled, and you cannot activate it. For number type fields (money, int, float), the default is inactive for detailed forms.

Wednesday, September 5, 2018

Important changes in Dynamics 365 (Version 9)



In recent versions of MS CRM there are lot of changes or modification done by Microsoft as well few things are get deprecated. Below are important changes done Dynamics 365 latest version for development point of view.

While development of the latest version we should be careful about deprecated methods of API. The deprecated client APIs will continue to be available and supported until they are officially removed from a future major release of Dynamics 365.
The changes listed below are not all of them, I am trying to list down here only those which we always use while development. Complete list is listed with the URL- https://docs.microsoft.com/en-us/dynamics365/get-started/whats-new/customer-engagement/important-changes-coming

Xrm.Page. context Changes

Deprecated API
Replacement API
globalContext.userSettings.getTimeZoneOffsetMinutes
globalContext.userSettings.userId
globalContext.userSetings.languageId
globalContext.userSettings.userName
globalContext.userSettings.securityRoles
globalContext.organizationSettings.isAutoSaveEnabled
globalContext.organizationSettings.languageId
globalContext.organizationSettings.uniqueName
No change in the method, but use "typename" instead of type for lookup attributes.





Grid Methods Changes
Deprecated API
Replacement API
Description
GridRow.data
GridRow is essentially a form context. This change unifies the interface of GridRow with formContext.
GridRowData.entity
GridRowData is form data. This change unifies the interface of GridRowData with formContextData.





Xrm.Utility Changes

Deprecated API
Replacement API
Description
Xrm.Navigation.openAlertDialog
The new signature is consistent with other APIs (openForm) and takes a new set of parameters for flexibility.
Xrm.Navigation.openConfirmDialog
The new signature is consistent with other APIs (openForm) and takes a new set of parameters for flexibility.
Xrm.Utility.getEntityMetadata
The isActivityType method is synchronous so it was suitable for ribbon rules. However, the replacement method, getEntityMetadata, is asynchronous, and is not suitable for ribbon rules.
Xrm.Navigation.openForm
Moving navigation actions to Xrm.Navigation
Xrm.Navigation.openForm
Moving navigation actions to Xrm.Navigation
Xrm.Navigation.openWebResource
Moving navigation actions to Xrm.Navigation
Note: This API returns VOID in Unified Interface.




New client APIs

Here is a list of new namespaces in this release that contains new and some existing methods that are moved under these namespaces for an enhanced object model design.

New Namespace
Description
Provides methods to use native device capabilities of mobile devices.
Provides methods to encode strings.
Provides navigation-related methods.
Provides properties and methods to use Web API to create and manage records and execute Web API actions and functions.





The following new APIs were introduced in the existing namespaces:

Namespace
New APIs
- OnLoad event and even handlers (addOnLoad and removeOnLoad)
- isValid
- Updated saveOptions in the formContext.data.save method to include a new value called saveMode to let the onSave event handlers know why the save is happening
- attributes collection
getEntityReference
isValid
isValid
setPrecision
event handlers for the OnLoad event (addOnLoad and removeOnLoad)
getAllowedStatusTransitions
getEntityMetadata
getGlobalContext
getLearningPathAttributeName
getResourceString
invokeProcessAction
lookupObjects
showProgressIndicator
closeProgressIndicator
refreshParentGrid

Silverlight (XAP) web resource is deprecated

The Silverlight (XAP) web resource is deprecated on the web client, and is not supported on the new Unified Interface introduced in the Dynamics 365 (online), version 9.0. Instead of Silverlight web resources, you must use custom controls created using the HTML web resources with HTML5 to create UI components to visualize and interact with data.



QueryExpression vs. FetchXML in MS CRM with C#

Microsoft Dynamics CRM (Customer Relationship Management) is a powerful platform that helps organizations streamline their business processe...