Advertisements
Home > Dynamics 365 > [D365 CE Online] Debug Async Plug-in using “Persist to Entity” profiler option

[D365 CE Online] Debug Async Plug-in using “Persist to Entity” profiler option

As you are aware, using Plug-in Profiler option we can debug D365 online plug-ins by throwing exception and capturing the Serilaized profile. Refer my previous article

With the ‘Exception’ profiling option, you first need to trigger the event and capture the exception log. For example, if you need to debug “Post Account Create” plug-in, you first need to trigger the event (i.e., Create Account from D365 application) and capture the exception log. This ‘Exception’ option would be apt, if your plug-in registered in Sync mode.

What if your plug-in is Async? Answer is, using “Persist to Entity” profiler option.

Plugin Profile 1

Let’s see how to debug Async Plug-in step by step.

Configuring Profiler in Plugin Registration Tool:

  • Connect to your Dynamics instance using Plug-in registration tool.
  • Click on ‘Install Profiler’ button
  • Register a new plug-in assembly and add an Async step
    • In this article, I registered an Async step on Post Account Creation

Plugin Profile 9

  • Select the Plug-in step and click on ‘Start Profiling’
  • In the “Profiler Settings” screen, choose “Persist to Entity” option and click “OK”

Plugin Profile 1

Trigger Account Creation from D365 Application:

  • Connect to D365 application and create a new Account

Plugin Profile 8

  • As we opted for “Persist to Entity” profiler option, an entry will get created in “Settings -> Plug-in  Profiles” entity.
  • Go to “Settings -> Plug-in  Profiles”, open the newly created “Plug-in  Profile” record (Note: Async plug-in takes time to create a new “Plug-in Profile” record).

Plugin Profile 2

  • In the “Plug-in Profile” record, you would notice the Serialized content in “Serialized Profile” field. This is same as what you get in Exception download log if you would have opted for “Exception” profile setting.

Plugin Profile 3

Debug the Plug-in:

Once an entry got created in “Plug-in Profile” record

  • Open the Plug-in class file in Visual Studio and attach “Plug-in Registration Tool” process

Plugin Profile 5

  • Add a break point in your Plug-in class file to debug.
  • Open the “Plugin Registration Tool”
  • Select the Plug-in step and click on “Debug/REPLAY PLUG-IN EXECUTION” button
  • In the “Replay Plug-in Execution” screen, set
    • Profile = Click on ‘Down Arrow’ button to pick your “Plug-in Profile” record from D365 (Refer screen)
    • Assembly Location = Plug-in dll
    • Plugin = Class Name

Plugin Profile 10

  • Click on “Start Execution”

Plugin Profile 11

  • You should see a break point hit in Visual Studio.

Plugin Profile 7

  • Press F10 to proceed with debugging.

🙂

 

 

Advertisements
  1. December 1, 2018 at 9:12 PM

    Reblogged this on Nishant Rana's Weblog.

  2. andriibutenko
    December 2, 2018 at 12:04 AM

    Are you aware that there is no need on copy pasting from profile to text file? There is a button with down arrow in replay plugin execution window that download profile from crm.

    • December 2, 2018 at 8:36 AM

      Thanks for the feedback Andri. Updated the post.

  1. December 1, 2018 at 9:16 PM

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: