Archives

Archives / 2018 / August
  • 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.

    Pre-Image:

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

    Post-Image:

    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 salesteam@mtccrm.com.

     

  • Workflows vs. Plug-ins

    S.NO

    Workflows

    Plug-ins

    1.

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

    Plug-ins have more events

    2.

    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.

    3.

    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.

    4.

    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.

     

    5.

    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. 

    6.

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

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

    7.

    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 salesteam@mtccrm.com 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.  

    Step1:

    • 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.

    Step2:

    • 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.

    Step3:

    • 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.

    Step4:

    • 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.

    Step5:

    • 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.

    Step6:

    • 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!

     

     

     

     

       

       

       

    Please Wait