Santosh Rawat
Santosh Rawat

Reputation: 61

Why Pre-Operation is used during Update a Plug-In

In Microsoft Dynamics CRM Plug-in why at Event Pipeline stage of execution is used Pre-Operation for "Update" message while adding a step in a plug-In. could anyone elaborate this?

Upvotes: 0

Views: 1807

Answers (2)

Alex
Alex

Reputation: 23300

MSDN elaborates quite a bit about it: see Event Execution Pipeline.

Abstract (copy-pasted from the linked page):

The Microsoft Dynamics CRM event processing subsystem executes plug-ins based on a message pipeline execution model. A user action in the Microsoft Dynamics CRM Web application or an SDK method call by a plug-in or other application results in a message being sent to the organization Web service. The message contains business entity information and core operation information. The message is passed through the event execution pipeline where it can be read or modified by the platform core operation and any registered plug-ins.

Upvotes: 1

James Wood
James Wood

Reputation: 17562

The plugin pipeline includes the following stages; pre-validation, pre-operation, and post-operation.

Apart from a couple of exceptions these stages are always available. So for the update message the pre-operation is there because that is how the product is designed to work.

In an update message the pre-operation stage could be used for example to:

  • Stop plugin execution by throwing an exception.
  • Inspect values of the record before they are changed.
  • Alter the plugin Target object to change the update applied to the record.

Upvotes: 1

Related Questions