What are images In Dynamics365 CRM? Why are they used?

What are images in Dynamics365 cRM ?

In Dynamics365 CRM Images are used in plugins to help developers access and compare the entity data before and after an operation.

Types of Images

There are two main types of images used in Dynamics 365 CRM plugins:

  1. Pre-Image:
    • What It Is: A snapshot of the entity’s data before the operation (e.g., before the record is updated or deleted).
    • When It’s Used: Pre-Images are used when you need to compare the data before and after an update or when you need to access data that will be deleted.
  2. Post-Image:
    • What It Is: A snapshot of the entity’s data after the operation has occurred (e.g., after the record is created or updated).
    • When It’s Used: Post-Images are used to access the final state of the data after an operation has completed.

Real-Time Scenario: Automatic Notification on Account Status Change

Let’s consider a real-world example to see how images are used in Dynamics 365 CRM.

Scenario: Imagine you’re managing customer accounts in your CRM. You want to automatically notify account managers whenever an account’s status changes to “Critical,” indicating that the customer relationship needs immediate attention.

Solution Using Images:

  1. Step 1: Trigger the Plugin:
    • You create a plugin that triggers on the Update event of the Account entity.
  2. Step 2: Capture Pre-Image and Post-Image:
    • The plugin captures a Pre-Image of the account, which is a snapshot of the account data before any changes are made.
    • It also captures a Post-Image, which is the state of the account after the update.
  3. Step 3: Compare Images:
    • The plugin compares the status field in both the Pre-Image and Post-Image.
    • If the Pre-Image shows the status as “Normal” and the Post-Image shows the status as “Critical,” this indicates that the account status has been updated to “Critical.”
  4. Step 4: Send Notification:
    • Based on this change, the plugin automatically sends an email notification to the account manager, informing them that the account is now in a critical state.

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *