Debugging Pre Operation Plug-In Without Plug-In Trace Log

Linn Zaw WinDyn365CE2 years ago18 Views

Recently, I developed a plugin which triggers on pre-operation stage. As
typical pre-operation plug-ins, the logic is to intercept the
InputParameters and modify them based on custom logic.
After deploying the plug-in to the Development environment, I just got a
generic error as below when I tested by making a change that would trigger the
plug-in. There is no arrow icon to expand for the detailed error message or no
button to download the error log either.
When I checked the Plug-In Trace Logs, there is no entry with an
exception. I updated the plug-in trace log level in System Settings to
All but there is no error message in my custom plug-in trace
either.

There is no error in the plug-in trace log because the error is in the main
operation due to invalid InputParameters after the completion of the custom
plug-in and there was no error in the pre-operation plug-in. In that case,
debugging using a plug-in profiler would not be helpful either because
the error happens after the plug-in triggers.
If you are in a similar situation as me and want to see the error message in
the main operation,
  1. Open the DevTools of the browser, Open the Network tab
  2. Clear if there are a lot of Network requests. After that, replicate the
    issue and click on the request (the red one) with status 403
    (Forbidden) or status 500 (Internal Server Error)
  3. In the Response tab, for that particular request
  4. You will see the detailed message of the error. (In my case, setting a
    wrong object to the PrincipalAccess property 🤦‍♂️)

This method can be used to decipher some of those generic error messages
like “An error has occurred.”, “You do not have {0} permission to access
{1} records.”, etc. without more detailed message or a button to download the
log file. You can read more about it in
my previous blog post.

Original Post http://linnzawwin.blogspot.com/2022/09/debugging-pre-operation-plug-in-without.html

0 Votes: 0 Upvotes, 0 Downvotes (0 Points)

Leave a reply

Follow
Sign In/Sign Up Sidebar Search
Loading

Signing-in 3 seconds...

Signing-up 3 seconds...