The Microsoft Dynamics CRM Platform Enhancement Discussion

  • Event Pipeline, Pre-Images & Post-Images in Dynamics CRM

    Event Pipeline: The even pipeline allows you to configure when in the event the plug-in code will execute. There are 3 Event Pipeline stages namely, Pre-Validation, Pre-Operation, and Post-Operation.

    Pre-Validation: In the pre-validation stage, security checks are performed to verify whether the calling or logged on user has the valid permissions to perform the intended operation.

    Pre-Operation: Plug-in will run after validation and before the values are saved in the database.

    Post-Operation: Plug-in will run after the values have been inserted or changed on the database.

    Pre-Images & Post-Images?

    Entity images are snapshots of CRM records that are stored on database either before the database operation is completed or after the completion of database operation.


    It is the snapshot of the entities’ attributes data before saving on the database. The following image shows pre-image availability.


    It is the snapshot of the entities’ attributes data after saving on the database. The following image shows post-image availability.

    Pre-Image & Post-Image Example:

    Whenever a parent account field is updated on the account entity, we want to retrieve the old value of the field and update in pre-value field.

    Register a plug-in in account entity and register a step update account name field and select stage as post-operation.

    Register an image step on update step. Give some names to pre-image and post-image checkbox Select attribute to display pre and post image values.

    Example Code for Pre-Image and Post-Image

    Here we update the account name and parent account.

    Pre-Image value updated with parent account value and Post-image value of phone field updated with postvalue of parent account field.

    Need help in Microsoft Dynamics 365/CRM Plug-in development? Contact


  • Workflows vs. Plug-ins





    Workflows have limited events like create, update, send mails, etc.

    Plug-ins have more events


    Less impact on server response time because the code is run in a different process.

    Synchronous plug-ins can increase the platform’s response time because they are part of the main platform processing.


    Asynchronous plug-ins have less impact on server response time because the code is run in a different process.


    Workflows can be created by an end user who may not have developer skills.

    Plug-ins can be created developers only because it needs coding and developer skills.


    Workflows triggered automatically run under the security context of the workflow owner.


    Plug-in execute under the security context of the crm web application pool identity.



    Works well for either short or long processes.

    A plug-in registered for synchronous or asynchronous execution is restricted to complete its execution within a 2 minute time limit. 


    When the Microsoft Dynamics CRM for Outlook client is offline, Workflows do not execute.

    Plug-in works in both offline and on-line.


    Workflows cannot use impersonation.

    Plug-ins can perform data operations on behalf of another system user.

  • What is Shared Variable in Plug-in?

    A Plug-in is a custom business logic code which is used to execute an action when a particular event takes place. It acts as event handlers in CRM and is triggered in events like create, update, delete, etc. Plug-ins are used to automate processes like sending emails to customers when some events take place in CRM.

    Shared Variables in Plug-in:

    Shared Variables in Plug-in was introduced in CRM 4.0. Shared variables are used for passing data between plug-ins registered on both pre and post events. So, instead of storing values in custom attributes, they can be stored in context variable. Read and write data into shared variables of context.

    Real-time Shared Variables Business Scenario:

    In the invoice entity, we wanted to change the exchange rate field but couldn’t do it because we were unable to change the value of base currency. So, we decided to use shared variables to change the exchange rate field of the invoice entity.  Let’s see how it’s done.

    Add a data into shared variable context in plug-in.

    And the below code shows shared variable data used in another plug-in.

    After completing plug-in registration in CRM, register a new step, i.e., select update event and primary entity as invoice and select pre-operation.

    Register a new step into another plug-in, i.e., select retrieve exchange rate event &primary entity as transaction currency and select post-operation.

    Do you have any requirement for CRM Plug-ins? Get help from experts. Contact now!

  • MTC Unveils New Feature in Super Grid for Additional Ease of Editing in Microsoft Dynamics 365/CRM

    MTC has come up with another smart feature to boost its Super Grid add-on functionality by using which users can have entities such as Email, Appointment, Phonecalls, Tasks, and Notes to be displayed on the home grid for easy access to wider details and addition of new records. Super Grid users will love this cool feature as it is easy-to-configure and saves tons of their time.

    Let’s see how the configuration is done below.  


    • Navigate to Sales --> Accounts and select any existing record or create a new record.
    • For e.g., Coho Winery here.

    • Open the record. Click Form.

    • Form window opens up.
    • Navigate to Insert tab. Click One Column. Go to Section, add 5 Columns by clicking One Column five times.


    • Double click on Tab.
    • Give Name it in the format tab_activitygrid
    • Enter the Label name
    • Tick all the check boxes

    • Click OK
    • The tab name will be changed to CRM Activities.


    • Select the first section under Tab and add Web Resource “mtc_/HTML/ActivityButtons.html”
    • Enter Name as ActivityButton while Label will be automatically picked as ActivityButton.

    • Click OK
    • The web resource will be added and the section name will be changed to Activity Button.


    • Double click the second the section to Name and Label the activity.
    • Enter Name in the format “tab_section_emails”
    • Give Label with the Activity Name such as Emails.

    • Click OK.
    • The section name will be changed to Emails.


    • Select the Emails section and add the Web Resource mtc_/EditGrid/CustomGridPage.html”
    • Enter Name as Emails so that the Label is automatically picked up.

    • Click OK
    • Web Resource will be added to the Emails section.

    Similarly, name other sections with the required activities by following Step 4 and add web resources by following Step 5.


    • You will notice a custom grid for the activities configured on the account record.

    • Click on the Email tab. Go the Settings Page.
    • Select Entity and Entity View from the drop down.

    • Click Save & Close.
    • You can now start adding new email items on the fly.

    • Click +NEW to open the email form in the window.

    • Select an email record and click Attachment to browse and add attachments.

    Similarly, repeat Step 6 for other activities such as Appointments, Phonecalls, Tasks and Notes.

    If you haven't tried Super Grid yet then you're losing time which could be better channelized for other business activities. Try Super Grid and save time!








    • How to Run Scheduler Using Microsoft Azure?

      Running a scheduler for repeat actions will save tons of your time and make you and your team more efficient and productive. Microsoft Azure unlocks many developmental capabilities, but let us learn how to use Microsoft Azure for running a scheduler.

      Use Scenario: Imagine a situation where there is lot of junk files being created on your system which causes its slowdown and results in poor productivity. With great difficulty you have developed an exe which will clean up the junk files within a minute and restores your system performance. But, here is the challenge you need to run it daily or whenever you feel the system has slowed down. But what if the exe is executed automatically? Doesn’t that sound amazing? Yes it is. Running a scheduler using Microsoft Azure can solve this problem. See the procedure below.

         1. Log into Microsoft Azure account with valid credentials.

         2. Navigate AppServices --> mtccrm --> WebJobs --> +Add as shown below

      Note: You can add your own App Service using +Add. In the above image, we took mtccrm for reference.

          3. Click +Add to add a new webjob. Webjob window appears as shown below.

      Name: Enter the name of the webjob.

      File Upload: Upload the zip file that contains the exe. (In case if the exe has the credentials to be configured then you are required to do it before uploading the zip file).

      Type: It can be continuous or triggered.

      • If you select triggered then you should select the appropriate triggers. The format in which you should input the time frequency is * 0/* * * * *.
      • First star (*) represents seconds, Second Star represents minutes, Third Star represents hours, Fourth Star represents days, Fifth Star represents weeks, and Sixth Star represents months.

      Let us take a sample zip file named as Debug_Azure_Scheduler and name of the webjob as Mission. See the image below.

      • If you select the type as Continuous then you will be able to select the Scale either as Multi Instance or Single Instance.

      A webjob with the given parameters will be created and displayed in the dashboard as shown below.

         4. Select the newly created webjob and click Run button on the ribbon as shown below.

      A dialog box pops up. Click Yes.

      You will get a successful message.

      Now click Logs button on the ribbon.


      You can see the list of webjobs run by you and their status.

      Click on the webjob to dive deep into the details.

      All the junk files on your system will be cleaned automatically. Likewise, you can run scheduler using Microsoft Azure for different use scenarios to save time and enhance your productivity.

      Want to discuss about Microsoft Azure Implementation for your daily use? Write to us at

    Please Wait