Thursday 10 December 2015

All about Plugins

Q. What is Execution Order in Plug-in Registration tool?


Execution order in plugin specifies the order in which plug-ins are executed within a pipeline stage. Plug-ins registered with an order value of 1 are executed first, followed by plug-ins registered with an order of 2, and so on. However, if there is more than one plug-in in a stage with the same order value, then the plug-in with the earliest compilation date is called first



What is the difference between PreImage, PostImage, Target Entity?

In a plug-in there are potentially several ways to access entity data relevant to the plug-in action. For example, on the create message you can access the data on the new entity instance in one of the following ways:
  1. Via the Target InputParameter
  2. Via an Image Entity registered on the step
Via a Retrieve request in the plug-in code


Availability of the data by stage
The general rules are:
1.       InputParameter is available in all stages. It can be modified in the pre-stage, but changing it in the post-stage will have no effect
2.       A PostImage Entity is available in the post-stage, and a PreImage Entity in the pre-stage only
3.       If using a Retrieve in the plug-in, then the data returned depends on the stage. In the pre-stage, you will see the data before the modification, whereas in the post-stage you see the data after the modification
4.       Some Image Entities are not relevant for some messages - e.g. there is no PreImage for a Create message, and no PostImage for a Delete message




1. All the plug-in events are first stored in  variable called “Target”.
Target  entity available on all steps and contains entity passed in the request message. Target entity can update on Pre-stage and those changes will be post into the database. Changes on Post-stage don’t affect database.

2. Pre-image, you get the image of the record as is stored in the SQL database before the CRM Platform action has been performed.
Post Image, returns the image of the record after the CRM Platform action has been performed. 

PreEntityImages and PostEntityImages contain snapshots of the primary entity's attributes before and after the core platform operation. Following tables describes PreImage, PostImage availability:



Pre-Image
Post-Image
Pre
Post
Pre
Post
Create
No
Yes
No
Yes
Update
Yes
Yes
No
Yes
Delete
Yes
Yes
No
No


Note. Target entity only contains attributes platform needs to update.

No comments:

Post a Comment