Plug in execution process in PreValidation & PreOpeation & PostOperation in D365

what if a plug in is registered on create message and with all the PreValidation , PreOperation and PostOperation what will happen if one got failed.

Below are the use cases for reference.

Account->Create

PreValidationAccountCreate

        Task Creation

PreOperaionAccountCreate

        Task Creation

PostOperationAccountCrate

          Task Creation


Below all scenarios I am trying to create a Task record.



Scenario :1

If exception happening in PreValidationAccountCreate before any CRUD operation. Account record will not create in this case

 

        ->PreValidationAccountCreate will trigger and will throw exception. It shows the trace log in plug in tracelog

        ->PreOperationAccountCreate will not trigger, and it will not show in plug in Trace log

        ->PostOperationAccountCrate will not trigger, and it will not show in plug in Trace log


Scenario :2

If exception happening in PreValidationAccountCreate after any CRUD operation is done. Account record will not create in this case

 

        ->PreValidationAccountCreate will trigger and will throw exception. But the task will be created, It shows the trace log in plug in tracelog

        ->PreOperationAccountCreate will not trigger, and it will not show in plug in Trace log

        ->PostOperationAccountCrate will not trigger, and it will not show in plug in Trace log


Code:

Task creation & Plug in trace log



Scenario :3

If exception happening in PreOperationAccountCreate before any CRUD operation is done. Account record will not create in this case

 

        ->PreValidationAccountCreate will trigger and creates a task. It shows the trace log in plug in tracelog . Task will create in this plug in.

        ->PreOperationAccountCreate will trigger, and it will show in plug in tracelog. Task will not create in this plug in.

        ->PostOperationAccountCrate will not trigger, and it will not show in plug in Trace log

Code:



Task creation & Plug in trace log

Scenario :4

If exception happening in PreOperationAccountCreate after any CRUD operation is done. Account record will not create in this case.

 

        ->PreValidationAccountCreate will trigger and creates a task. It shows the trace log in plug in tracelog

        ->PreOperationAccountCreate will trigger, and it will show in in plugin trace log. Task will not create in this plug in.

        ->PostOperationAccountCrate will not trigger, and it will not show in plug in Trace log

Code:



Task creation & Plug in trace log

Scenario :4

If exception happening in PostOperationAccountCreate before any CRUD operation is done. Account record will not create in this case.

 

        ->PreValidationAccountCreate will trigger and creates a task. It shows the trace log in plug in tracelog

        ->PreOperationAccountCreate will trigger, and it will show in in plugin trace log. Task will not create in this plug in.

        ->PostOperationAccountCrate will trigger, and it will show in plug in Trace log.

Code:

Task creation & Plug in trace log:

Scenario :5

If exception happening in PostOperationAccountCreate after any CRUD operation is done. Account record will not create in this case.

 

        ->PreValidationAccountCreate will trigger and creates a task. It shows the trace log in plug in tracelog

        ->PreOperationAccountCreate will trigger, and it will show in in plugin trace log. Task will not create in this plug in.

        ->PostOperationAccountCrate will trigger, and it will show in plug in Trace log.

Code:


Task creation & Plug in trace log:

 

 

 








Comments

Popular posts from this blog

Connecting Dynamics 365 Web api using external HTML page

Get azure blob files inside Sub Directories

Interview questions on MS CRM