Debug a Plugin – Persist to Entity

Leave a comment

There may be instances where you are debugging a plugin in Dynamics 365 and when you run the profiler, it produces the error “An error has occurred. The selected action was not completed for one or more records.”

You may be running the profiler under the setting Exception:

In order to get around the error, use the Persist to Entity setting.

Select the setting and click OK to start profiling. Then, run your action which causes the profiler to run. You will not see a dialog box like you do with the Exception setting, which downloads a file. Instead, everything will run as expected.

Attach Visual Studio debugger to the Plugin Execution Tool process, so it is ready to debug, and set a breakpoint in your code:

Next, in the Plugin Registration Tool, stop profiling, and go to Debug:

This will open the Replay Plugin Execution window. Select the drop down arrow:

From here you will see a line with the time and details for each profile that has been run. Select the profile that you want to debug:

Also note, if you are debugging many to many relationships, you may see multiple entries in this section. There is an entry for each of the target entities.

Then select the assembly and plugin.

Click Start Execution:

You can now debug your code.

 

THANKS FOR READING. BEFORE YOU LEAVE, I NEED YOUR HELP.
 

I AM SPENDING MORE TIME THESE DAYS CREATING YOUTUBE VIDEOS TO HELP PEOPLE LEARN THE MICROSOFT POWER PLATFORM.

IF YOU WOULD LIKE TO SEE HOW I BUILD APPS, OR FIND SOMETHING USEFUL READING MY BLOG, I WOULD REALLY APPRECIATE YOU SUBSCRIBING TO MY YOUTUBE CHANNEL.

THANK YOU, AND LET'S KEEP LEARNING TOGETHER.

CARL

https://www.youtube.com/carldesouza

 

ABOUT CARL DE SOUZA

Carl de Souza is a developer and architect focusing on Microsoft Dynamics 365, Power BI, Azure, and AI.

carldesouza.comLinkedIn Twitter | YouTube

 

Leave a Reply

Your email address will not be published. Required fields are marked *