exam questions

Exam PL-400 All Questions

View all questions & answers for the PL-400 exam

Exam PL-400 topic 6 question 7 discussion

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

DRAG DROP -
You are developing a Power Platform app for a school. The school plans to use the app to gather information about classes and students.
You must design a plug-in for the app. You must store data about students in the Contacts table and store data about classes in a custom table.
You need to select the stage in the event pipeline for each function.
Which stages should you use? To answer, drag the appropriate plug-in stages to the correct functions. Each plug-in stage may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.
NOTE: Each correct selection is worth one point.
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:
Box 1: 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: PreOperation -
Occurs before the main system operation and within the database transaction.
If you want to change any values for an entity included in the message, you should do it here.
Avoid cancelling an operation here. Canceling will trigger a rollback of the transaction and have significant performance impact.

Box 3: PostOperation -
Occurs after the main system operation and within the database transaction.
Use this stage to modify any properties of the message before it is returned to the caller.
Reference:
https://docs.microsoft.com/en-us/powerapps/developer/data-platform/event-framework

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
sumiiiiiiiii
Highly Voted 3 years, 6 months ago
Correct answer
upvoted 13 times
...
HiJaak
Highly Voted 1 year, 9 months ago
Last one cannot be PostOperation as https://learn.microsoft.com/en-us/power-apps/developer/data-platform/event-framework states: "Occurs after the main system operation and within the database transaction. Use this stage to modify any properties of the message before it is returned to the caller. Avoid applying changes to an entity included in the message because this will trigger a new Update event." So it should be: 1. PreValidation 2. PreOperation 3. PreOperation
upvoted 5 times
...
Juan0414
Most Recent 3 months, 3 weeks ago
PreVal - "cancel" is needed PreOp - Records needs to be updated and if cancel occurs "rollback" PostOp - You won't be updating the Record from the same message because the relationship between Contacts (Students) and Classes should be Many-to-Many (An student can enroll into many classes, and classes can have many students). So, in many to many relationships a third (Intersection) table is created, and that is the table that will be updated when you "assign a student to a class" "Any external actions, like creating relationships between entities or triggering external processes, should be done after the main transaction has completed" ->PostOp
upvoted 1 times
...
SvetlankaP99
11 months, 1 week ago
PreValidation PreValidation (not PreOperation because - avoid cancelling operation in PreOperation) PreOperation
upvoted 1 times
Juan0414
3 months, 3 weeks ago
Key word is "rollback" and that only happens in PreOp
upvoted 1 times
...
...
hai297
1 year, 2 months ago
PreValidation PreOp PreOp You must store data about students in the Contacts table and store data about classes in a custom table => should change in PreOpt and in the transaction
upvoted 1 times
SvetlankaP99
11 months, 1 week ago
Second can't be PreOperation, it's PreValidation, because of Rollback
upvoted 1 times
greendend
6 months, 1 week ago
FYI: Pre-validation stage executes outside Database Transaction which will not rollback the entire operations written in the plugin if there is any runtime error occurs in one operation. This provides an opportunity to include logic to cancel the operation before the database transaction. Pre-Operation stage executes inside database transaction due to which any runtime error occurs in a single operation in the plugin will rollback entire operations which are part of the plugin. If you want to change any values for an entity included in the message, you should do it here. So PreOperation for the 2d point is the only one correct answer. + we need to make Update that is not possible via PreValidation
upvoted 2 times
...
...
...
At09
1 year, 8 months ago
useless question.. but go with what you guys say
upvoted 1 times
...
MikeAWS
1 year, 10 months ago
1. PreValidation - In our case, we want to cancel a class if the student is over 15 years old. This involves validating the student's age before allowing the class operation to proceed. The PreValidation stage is the most appropriate because it lets you check the student's age and conditionally cancel the class operation before validation occurs. 2. PreOperation - in this case, the requirement is to update the record and potentially roll back changes if an error occurs. The PreOperation stage is the appropriate choice because you can update the record and throw an exception to roll back changes if needed. 3. PreOperation - since we need to determine the appropriate class for the student before the main operation of adding the student is executed, the PreOperation stage is the appropriate choice for this scenario.
upvoted 5 times
...
MikeAWS
1 year, 10 months ago
1. PreValidation 2. PreOperation 3. PreOperation
upvoted 3 times
...
jkaur
1 year, 10 months ago
-PreValidation -PreOperation -PostOperation
upvoted 4 times
...
SuperRaj
2 years ago
PreValidation PostOperation PostOperation
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 ...