Posts

Ribbon Customization: Display Rules Based on Security Roles

Image
Some organizations need to allow certain users to access buttons on the Ribbon or Command Bar, while allowing others to utilize them based on the users’ security privileges. If you think this cannot be done, good news! It can! There are a few different ways to accomplish this functionality, and in today’s blog, we will show you how to solve your security role headaches. Let’s dive in! The steps outlined below require no coding and can be easily implemented utilizing the Ribbon Workbench and out-of-the-box security roles. To accomplish this, we created a custom entity (po_Security) to manage the display rules, however, this is  not  required as the exiting entities and privileges can be used. We created the new entity to ensure that no existing entity privileges were going to be effected, but the same principles will apply regardless if you chose to create a new entity or not. 1. First, start by downloading and installing the  Ribbon Workbench . 2. In CRM, create a new solution

Real-Time Workflow vs Plugin: Execution Order

Image
Like plugins, real-time workflows are executed before (pre-operation) or after (post-operation) the core operation. Both are executed inside the same database transaction. Here are outlined some actions I have executed in order to evaluate their execution order: Customization of a custom entity named Entity A which contains two text fields named ‘Plugin Text’ and ‘Workflow Text’; Registration of two synchronous plugin steps for Pre Update and Post Update, which are triggered when the Entity A name field is updated: Pre Update Event: sets ‘Plugin Text’ with PLUGIN | PRE UPDATE; Post Update Event: sets ‘Plugin Text’ with PLUGIN | POST UPDATE; Creation of two real-time workflows; one runs before the update and the other runs after the update. Both are triggered when the Entity A name field is updated: Before Update: sets ‘Workflow Text’ with Workflow | PRE UPDATE; After Update: sets ‘Workflow Text’ with Workflow | POST UPDATE; Then after created and Entity A record, upd

Duplicate Record Detection Plugin

Hi , Recently I had a requirement to create Duplicate detection rule using c# (Plugin) in Account Entity, to avoid redundancy. You can try like bellow method 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 using System; using System.Collections.Generic; using System.Linq; using System.Text; //CRM SDK Namespace using Microsoft.Xrm.Sdk; using Microsoft.Xrm.Sdk.Query; using Microsoft.Crm.Sdk.Messages;   namespace Sample {      public class Duplicate_Detection : IPlugin      {          public void Execute(IServiceProvider serviceProvider)          {              IPluginExecutionContext context = (IPluginExecutionContext)serviceProvider.GetService( typeof (IPluginExecutionContext));              IOrganizationServiceFactory serviceFactory = (IOrganizatio