exam questions

Exam PL-400 All Questions

View all questions & answers for the PL-400 exam

Exam PL-400 topic 7 question 30 discussion

Actual exam question from Microsoft's PL-400
Question #: 30
Topic #: 7
[All PL-400 Questions]

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.

After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.

A company requires custom validation when users save form records that use a synchronous plug-in.

If validation fails, a message that explains how to resolve the issue must be displayed on the form to the user.

You need to implement the custom validation.

Solution: Throw a custom exception with the message.

Does the solution meet the goal?

  • A. Yes
  • B. No
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
itmaxuser
4 days, 7 hours ago
Selected Answer: B
In Microsoft Dataverse (Dynamics 365): 🔴 Custom exceptions (e.g., your own MyValidationException) Will not display a friendly error message to the user. Instead, the platform will catch it and show a generic or technical error, or log it as an unhandled exception. The message is not reliably shown on the form or may even be hidden completely. InvalidPluginExecutionException Is the only supported way to throw an error from a plug-in that: Cancels the operation And displays the message directly to the user on the form It integrates with the platform’s error handling UI.
upvoted 1 times
...
hulendar
1 week, 3 days ago
Selected Answer: B
InvalidPluginExecutionException is not custom exception
upvoted 1 times
...
Juan0414
1 month, 2 weeks ago
Selected Answer: A
InvalidPluginExecutionException is considered a custom exception (You can add a custom message and details), so Yes
upvoted 1 times
itmaxuser
4 days, 7 hours ago
InvalidPluginExecutionException is not a custom exception — it's a built-in exception used for exactly this purpose.
upvoted 1 times
...
...
rp2
3 months, 1 week ago
Selected Answer: A
It should be yes
upvoted 1 times
...
KucaStonojka
4 months, 4 weeks ago
Selected Answer: A
Throwing a custom exception with a message is an effective way to perform custom validation in a synchronous plug-in for Dynamics 365. This approach allows you to interrupt the save operation and display a clear and user-friendly message on the form. When the validation fails, the plug-in can throw an InvalidPluginExecutionException or a custom exception, passing the validation error message. Example: throw new InvalidPluginExecutionException("Validation failed: Please provide the required information."); This exception halts the operation and displays the message to the user directly on the form, allowing them to correct the issue before proceeding.
upvoted 2 times
...
FCTopics
11 months, 1 week ago
Original answer is correct Solution: Throw an InvalidPluginExecutionException with the message. To show a custom message you should use InvalidPluginExecutionException no a Custom Exception
upvoted 1 times
...
NNNT
1 year, 4 months ago
The Correct Answer Should be A. Yes To achieve the goal of displaying a user-friendly message on the form when validation fails, you should consider using the OrganizationServiceContext.ThrowInvalidPluginException method with a custom error message.
upvoted 3 times
PY12396
1 year, 2 months ago
I think the original answer is correct, because we need a custom message not a custom exception
upvoted 3 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago