Skip to Content

PL-400: Which Approach Ensures Custom Messages for Canceled Operations in Dataverse Plug-ins?

How to Handle Exceptions Without Rolling Back Transactions in Dataverse Plug-ins?

Table of Contents

Question

You create a plug-in to extend the default behavior of Microsoft Dataverse.

You register a step by using the Plug-in registration tool. You select Event Pipeline Stage of Execution.

You need to write code that meets the following requirements:

  • The code must handle any exception thrown.
  • The code must not require the entire transaction to roll back.
  • A message must appear if an operation is canceled.

What should you do?

Select only one answer.

A. Catch exceptions in the PreOperation stage and use InvalidPluginExecutionException class that contains the exception message.
B. Catch exceptions in the PreValidation stage and use the IpluginExceptionProvider interface that contains the exception message.
C. Catch exceptions in the PreOperation stage and use the IpluginExecutionContext interface that contains the exception message.
D. Catch exceptions in the PreValidation stage and use InvalidPluginExecutionException class that contains the exception message.

Answer

D. Catch exceptions in the PreValidation stage and use InvalidPluginExecutionException class that contains the exception message.

Explanation

This item tests the candidates’ knowledge of how to create a plug-in.

Canceling operations should be handled in the PreValidation stage. The InvalidPluginExecutionException class should contain the message about the canceled operation. You should avoid canceling operations in the PreOperation stage, because the operation will trigger the entire transaction to roll back. Canceling operations should be handled in the PreValidation stage, but the IpluginExecutionProvider interface does not provide an option to include the message about the canceled operation. You should avoid canceling operations in the PreOperation stage because the operation will trigger the entire transaction to roll back.

Microsoft Power Platform Developer PL-400 certification exam practice question and answer (Q&A) dump with detail explanation and reference available free, helpful to pass the Microsoft Power Platform Developer PL-400 exam and earn Microsoft Power Platform Developer PL-400 certification.