-
Notifications
You must be signed in to change notification settings - Fork 2
Configuration
One of the main complex things in building Plugin is getting the current data of the main entity target. There are two objects that CRM introduces: one is Target which is an object that has been changed in the UI or in the pre-operation and the second one is Pre Image, Post Image, or retrieving from the database directly using Service.RetrieveMultiple or Service.Retrieve API. This framework helps you to simplify this process to only getting from 1 object. Later on in the tutorial, you will understand that the framework had 3 objects inside:
- Context.Target which refers to the Target object
- Context.Initial which refers to the Pre Image/Post Image or Current object in the database.
- Context.Current which refers to a combination of Context.Initial + Context.Target
This configuration applies for that scenario:
If you want to add Pre Image or Post Image, name it as "EntityImage".
When creating Plugin Class, you can override the Configure method. This method helps you to set if no Pre or Post Image finds, the framework will retrieve from the database: The image above showing you how the Plugin Class configure to retrieve Entity cr953_subscription with attributes cr506_customerid and cr506_transactiondate.