Skip to content

Configuration

Temmy Wahyu Raharjo edited this page Apr 5, 2020 · 2 revisions

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:

Pre Image and Post Image Naming

If you want to add Pre Image or Post Image, name it as "EntityImage". EntityImage Pre Image and Post Image

Retrieve From Database

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: Configure Method The image above showing you how the Plugin Class configure to retrieve Entity cr953_subscription with attributes cr506_customerid and cr506_transactiondate.

Clone this wiki locally