Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam PL-400 All Questions

View all questions & answers for the PL-400 exam

Exam PL-400 topic 6 question 21 discussion

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

HOTSPOT -
A manufacturing company takes online orders.
The company requires automatic validation of order changes. Requirements are as follows:
✑ If validation is successful, the order changes must be submitted.
✑ If exceptions are encountered, a message must be shown to the customer and the order changes must not be submitted.
You need to set up and deploy a plug-in that encapsulates the rules.
Which options should you use? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
Hot Area:

Show Suggested Answer Hide Answer
Suggested Answer:
Box 1: PreValidation -
PreValidation: For the initial operation, this stage will occur before the main system operation.
This provides an opportunity to include logic to cancel the operation before the database transaction.

Box 2: Synchronous -
Ideally, you should only cancel operations using synchronous plug-ins registered in the PreValidation stage.

Box 3: Pre Image -
Box 4: throw ..
When you throw an InvalidPluginExecutionException exception within a synchronous plug-in an error dialog with your message will be displayed to the user.
Reference:
https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/event-framework https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/handle-exceptions

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Leila24
Highly Voted 3 years, 4 months ago
PreValidation stage is nor recommended for use due to security concerns. Pre Operation shall be the answer
upvoted 14 times
Shradz93
2 years, 1 month ago
Agreed! Pre validation means you plugin will run before the form is validated Pre -operation is after validation and before the values are saved to the database
upvoted 1 times
...
LorneMalvo
2 years, 3 months ago
No it shall not. As written in microsoft documentation: PreValidation - This provides an opportunity to include logic to cancel the operation before the database transaction. PreOperation - Avoid cancelling an operation here. Canceling will trigger a rollback of the transaction and have significant performance impact. See: https://docs.microsoft.com/en-us/power-apps/developer/data-platform/event-framework
upvoted 3 times
NyarukouSAMA
1 year, 1 month ago
Looks like Microsoft's recommendations have been changed, because previously Microsoft had recommended not to use PreValidation at all, except in some cases where you need to implement custom validation logic for the message.
upvoted 1 times
...
...
At09
1 year ago
I dont understand why people making simple things difficult. Pre Validation it is. No more arguments
upvoted 2 times
...
...
loecun
Highly Voted 2 years, 12 months ago
first one is correct. It's PreValidation. as per https://docs.microsoft.com/en-us/powerapps/developer/data-platform/event-framework#event-execution-pipeline, PreValidation provides an opportunity to include logic to cancel the operation, whereas for PreOperation, avoid cancelling an operation here because of performance impact.
upvoted 11 times
...
LSgeek
Most Recent 3 months, 1 week ago
correct
upvoted 1 times
...
rogrod
2 years, 1 month ago
Sorry, but I disagree... maybe i'm wrong but... Prevalidation would be the best option to cover "If validation is sucessful...", but not for "If exceptions are encountered..". Nothing is done at this momment at the database, so we can not be sure all the update operation (entire operation) will be done.. To be sure that the update operation (and all another process, plugins, etc, etc that can be triggered on a order update) the stage would be "PostOperation": At this momment all the operations has been done and we can be sure that all the process is fine. If a exception is encountered, we can throw an exception and rollback. So in my opinion: PostOperation (we cover all possible exceptions in the operation) Synchronous (need show an error to user) PreImage (we already have the post values in "target" because we are in Post stage) Throw new Invalid.....
upvoted 2 times
northstar88
2 years, 1 month ago
The requirement is: "The company requires automatic validation of order changes.". The scope is limited to validating an order change, not the order process itself. I think prevalidation is sufficient.
upvoted 1 times
...
...
Kalimho
2 years, 3 months ago
in exam 2022.07.21
upvoted 1 times
...
BlueP
2 years, 4 months ago
answers are correct for pre-validation vs pre-operation I'm not 100% as both could work and depending on the type of validation you might have to use pre-operation. But given how simple the question is I will go with pre-validation
upvoted 1 times
...
Aferdita
2 years, 7 months ago
https://www.examtopics.com/discussions/microsoft/view/25333-exam-mb-400-topic-5-question-6-discussion/
upvoted 2 times
...
CinthiaN
2 years, 8 months ago
IMO Is correct
upvoted 1 times
...
Hendrikdb
2 years, 12 months ago
Is correct answer, use prevalidation always for validating data before going to the preoperation. Preoperation is used for data manipulation before save and postoperation when you need to upsert related data
upvoted 3 times
...
Big_PP
3 years, 3 months ago
Should be post image no? So you can compare with the data you have at your disposal at execution.
upvoted 1 times
S41
3 years, 3 months ago
You need a snapshot of the entity before the operation to compare with the changes in the context of the plugin during the operation. Pre Image is correct.
upvoted 2 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 ...