Run action in plugin

Find below a method that will execute an Action in CRM based on the parameters received /// <summary> /// Trigger an Action in CRM. "parameters" parameter can be optional based on the action called, same for "targetEntity". /// </summary> /// <param name="ActionName"></param> /// <param name="TargetEntity"></param> /// <param name="service"></param> public static void CallAction(string actionName, StringDictionary parameters, … Continue reading Run action in plugin

Impersonating plugin as SYSTEM programatically

Frequently we have to execute plugins as Service Accounts so they have the right privileges to execute the business logic we want. Although you can set a user in the "Run In User Context" field of the plugin step, sometimes our organizations doesn't actually have service accounts to be used there. To programatically run a plugin … Continue reading Impersonating plugin as SYSTEM programatically

Associate records in plugin

When creating N:N relationships between entities, CRM allow us to associate records. This is a great functionality to track and reference records through entities. Although this can be done manually, find below a method to associate two records programmatically: