Showing posts from July, 2017


One of the keys to increase the usability of the interaction with your customers, and to adopt your system, is to notify you customers with your Dynamics users updates on a case. A tip of doing this, is to set a workflow to be triggered when a note is created on a case, the workflow will send an email to the customer, updating him/her with the note description. You can do this by following the below steps, 1. Create workflow to run on Note entity 2. in the workflow, add a condition to check if the note is regarding a case. 3. If the condition is met, then send email to the customer and place the note description in the email. 4. Save and activate the workflow. Thanks :)

Business Rules Vs Rollup Fields Vs Calculated Fields

Feature Trigger Execution Client / Server Scope Conditions Fields Functions Limits Usage Business Rules On Load On Change Synchrounous / Real Time Execution order: First: System JavaScripts Then: Custom Javascript   Finally: Business Rules Client: Specific Forms/ All Forms/ Server Entity / All Forms / Specific Forms And / OR, not a mixure All Fields on the form body Show Error Message Set Field Set Business Required Set Visibility Set Default Value Lock / Unlock Field Fields updated through Business Rules do not trigger the fields on change event of JavaScript. Reducing potential of infinite loop. Perform field validations and apply field logic to improve user input and experience Rollup Fields On Save / Every 1-12 hours / When User Presses Rollup Refresh Button Asynchronous / Every 1-12 hours Rollups are calculated by scheduled system jobs  Settings  >  System Jobs  >  View  >  Recurring System Jobs . System Job type: Mass Calculate Rollu

Multi-Select Option Set in Dynamics 365

A new feature "Multi-Select Option Set" is introduced in Dynamics 365. Very useful feature, it will reduce lot of effort for the developers. In one of our project we used an external IP to implement this. Few screen shots on this awesome feature.


If you had a requirement where you want to retrieve a list of options of an option set in your CRM/365 organization depending on the language, for example if you pass to the method 1025 it will return the options in Arabic, if you pass 1033 it will return the options in English and so on. For example, if you are integrating your Dynamics 365 with a portal, and you want to create a drop down list of these options coming from an option set in the 365, and this options maybe changed in the future, so its not practical to change the drop down list options. In this case, I'm going to give you a code I was using to listing data from CRM 2016 to SharePoint 2016. public Dictionary<int, string> LocalOptionSetList(String entityName, String optionSetName, int lcid)         {             try             {                 if (lcid == 0)                     lcid = 1033;// default english                 using (var xrmContext = new XrmServiceContext(CRMConnection.CRM))    

Best Practices when Writing Dynamics CRM Plugins

• For improved performance, Microsoft Dynamics 365 caches plug-in instances. The plug-in’s Execute method should be written to be stateless because the constructor is not called for every invocation of the plug-in. Also, multiple system threads could execute the plug-in at the same time. All per invocation state information is stored in the context, so you should not use global variables or attempt to store any data in member variables for use during the next plug-in invocation unless that data was obtained from the configuration parameter provided to the constructor. Changes to a plug-ins registration will cause the plug-in to be re-initialized. • Its a best practice to check for the target entity name and message name at the beginning of the plugin execute message to avoid running the plugin unintentionally. • When you want to update fields on a record, it’s good practice to create a new entity or early bound type of the record and only add the fields you want to upda

Allows the user to enter numbers in the field, and only allows two numbers after the decimal place.

After long time gap working on .NET/MVC I see developer are getting frustrated when adding validation on numbers & decimal digits. it's better to prevent the user from making a mistake than to correct him after", here is my solution. It only allows the user to enter numbers in the field, and only allows two numbers after the decimal place.  <script>       // Retrieve last key pressed.  Works in IE and Netscape.       // Returns the numeric key code for the key pressed.       function getKey(e)       {         if (window.event)            return window.event.keyCode;         else if (e)            return e.which;         else            return null;       }       function restrictChars(e, obj)       {         var CHAR_AFTER_DP = 2;  // number of decimal places         var validList = "0123456789.";  // allowed characters in field         var key, keyChar;         key = getKey(e);         if (key == null) return true;         // contr