Debugging a Plug-in for Model-Driven App | PL-400 Exam Preparation

Debugging a Plug-in for Model-Driven App

Question

You need to debug a plug-in for a model-driven app.

The plug-in proper cases the Account Name when you create a new Account record.

Please select the steps you should take before you click on the Debug in Plug-in Registration Tool.

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D. E. F.

Correct Answers: B, D and F

Power Platform provides a variety of tools to extend the platform and user experience.

If you need to work with the Dataverse, you can use the Dataverse Web API and Organization service.

Or develop your business logic by using the Dataverse plug-ins.

You can use Data import, Synchronization, Virtual entities, Azure integration, and Webhooks for integration purposes.

Suppose you need to debug your plug-in.

Because the plug-in is running on a remote server, you cannot just debug it directly.

You need to use the Plug-in Profiler to capture your app's operation, like creating the new Account record.

And then use the Profiler playback for the debugging of a plug-in code in Visual Studio.

Before you can use a Profiler, you need to Install Profiler from the toolbar in the Dataverse Plug-in Registration Tool.

After you register your Assembly and add a step with the “Create” message for the Account as Primary entity using the Dataverse Plug-in Registration Tool, you can click on the “Start Profiling” in the toolbar (Number 1)

The Tool opens the

Profiler Settings screen (Number 2)

After accepting the defaults and starting the profiler, you can switch to your app and add a new Account record.

The Profiler captures the operations.

MM Plugin Registration Tool

st CREATE NEW CONNECTION G! RELOAD ORGANIZATIONS | TE) REPLAY PLUG-IN EXECUTION — Qi VIEW PLUG-IN PROFILE

CBTrial x @

[Register > [QView + ‘%X Uninstall Profiler £4 Debug ‘5 Start Profiling [4Update [8 Disable [3 Unregister © Refresh OSearch  [§ Telemetry Disabled

Registered Plugins & Custom Workflow Activities *

Profiler Settings @

Step 1: Specify profile storage

4 @% (Assembly) FollowupPlugin
4 red (Plugin) PowerApps.Samples.FollowupPlugin - Isolatable
[E) (Step) PowerApps.Samples.FollowupPlugin: Create of account

> @% (Assembly) Microsoft.CDS.AdvancedAnalyticsinfra.Plugins Exception
b @ (Assembly) Microsoft.CDSApplicationUser.Pugins When the profiled component is triggered, an exception will be thrown with the compressed
> @& (Assembly) Microsoft.CDS.Catalog.Plugins profile in the error message.
> @% (Assembly) Microsoft.CDS.ChangeTrackingForVE.Plugins
> @ (Assembly) Microsoft.CDS.CustomAPIPlugins ©) Persist to Entity (Recommended)
> @ (Assembly) Microsoft.CDS.DataLakeWorkspaces.Plugins The profile will be stored in a custom entity for each profiled operation that occurs.
> @& (Assembly) Microsoft.CDS.ImageConfig.Plugins Persistence Key [81 12fb0637bf478'bods43e82f14399¢
> @& (Assembly) Microsoft.CDS.ManagedidentityExtensions.Plugins
> @% (Assembly) Microsoft.CDS.OrganizationDataSync.Plugins Step 2: Set profiler settings
Properties Details L Limit number of executions

Maximum number of executions 1
Name EntityAlias Type Attributes PropertyName Id

\¥_ Include secure configuration

Includes the secure configuration value in the profile for more comprehensive debugging. Please
note that the secure Configuration may include sensitive data.

OK Cancel

Then you return to the Tool and push the Debug button (Number 1)

It opens the Replay Plug-in Execution screen (Number 2)

The first field on the screens asks you to provide a recorder profile.

When you click on the download arrow icon (Number 3), the new screen “Select Profile From CRM” opens (Number 4)

Now you can select the captured profile (Number 5) and use it for code debugging.

AM Plugin Registration Too! - x
# CREATE NEW CONNECTION RELOAD ORGANIZATIONS | (5) REPLAY PLUG-IN EXECUTION a VIEW PLUG-IN PROFILE FO ?

CBTrial x @ x

[Register + [QView + ‘€ Uninstall Profiler {£1Debug & StopP: Replay Plug-in Execution @

Registered Plugins & Custom Workflow Activities Setup Unsecure Configuration Secure Configuration Settings

Retrieve Log

4 @ (Assembly) FollowupPlugin

4 [Ig (Plugin) PowerApps.Samples.followupPlugin - Isolatable To collect the log, do the action that triggers the plug-in. When the exception occurs,

“fp (Step) PowerApps.Samples.FollowupPlugin: Create of account (Profile: download the error keg and specify the path: below.

> @ (Assembly) Microsoft.CDS.AdvancedAnalyticsinfra.Plugins Profile Pe

> & (Assembly) Microsoft.CDS.ApplicationUser.Plugins

> @ (Assembly) Microsoft.CDS.Catalog.Plugins Specify Assembly x

> @ (Assembly) Microsoft.CDS.ChangeTrackingForVE.Plugins | -

> @ (Assembly) Microsoft.CDS.CustomAPl Plugins Assembly Location Select Profile From CRM (4)

> @& (Assembly) Microsoft.CDS.DataLakeWorkspaces.Plugins Plugi 4

lugin .
> @& (Assembly) Microsoft.CDS.ImageConfig.Plugins Specify Log Item To Use
> @& (Assembly) Microsoft.CDS.ManagedldentityExtensions.Plugins 7 . . .
. oe ‘ To collect the logs, configure the plugin step you wish to collect info on for profiling to the server. Then
> @ (Assembly) Microsoft.CDS.OrganizationDataSync Plugins perform the task that exercises the step. Once complete, select the profile from the list below. y]
Properties Details Plug-in Traces Created a~ Type Name Entity Message Profile a

Name EntityAlias Type Attributes PropertyName Id Attach Visual Studio to the PluginRegistratior

Select Close

All other options are incorrect.

For more information about the Dataverse Plug-in Registration Tool Profiling, please visit the below URLs:

Before debugging a plug-in for a model-driven app, it is essential to ensure that the environment is set up correctly and that the necessary tools are in place to debug the plug-in effectively. Here are the steps you should take before clicking on the "Debug" button in the Plug-in Registration Tool:

  1. Install the Profiler: If you haven't installed the profiler yet, you need to install it. The profiler is a tool that helps in debugging plug-ins by tracing the plug-in's execution path and capturing valuable information such as the input parameters, output parameters, and exceptions thrown.

  2. Start Profiling: Once the profiler is installed, you need to start profiling the model-driven app where you intend to debug the plug-in. Profiling will capture all the necessary information needed to debug the plug-in.

  3. Stop Profiling: After starting the profiling process, you need to perform the action that triggers the plug-in's execution, which in this case is creating a new account record. Once the action is completed, you need to stop profiling.

  4. Attach to PluginRegistration.exe process: Once the profiling is stopped, you need to attach to the PluginRegistration.exe process. This process will allow you to debug the plug-in.

  5. Select Profile From CRM: After attaching to the PluginRegistration.exe process, you need to select the profile from CRM that was captured during the profiling process. This will enable you to view the captured information, including the input parameters, output parameters, and exceptions.

In conclusion, the steps you should take before clicking on the "Debug" button in the Plug-in Registration Tool are to install the profiler, start profiling the model-driven app, stop profiling, attach to the PluginRegistration.exe process, and select the profile from CRM. By following these steps, you will be able to effectively debug the plug-in for the model-driven app.