exam questions

Exam MB-500 All Questions

View all questions & answers for the MB-500 exam

Exam MB-500 topic 4 question 14 discussion

Actual exam question from Microsoft's MB-500
Question #: 14
Topic #: 4
[All MB-500 Questions]

HOTSPOT -
You are a Dynamics 365 Finance developer.
You have the following class definition:

You need to create an extension class and wrap the method by using Chain of Command (CoC). If the value of the Qty variable is less than 5, the code must cause an exception.
How should you complete the code segment? 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: final class WebShopOrderVal_Extension
Box 2: public static void checkQtyValue(int Qty)
Incorrect Answers:
Public void ג€¦
If a static method is the target that will be wrapped, the method in the extension must be qualified by using the static keyword.

Int Qty=0 -
The method signature in the wrapper method must not include the default value of the parameter.

Public int -
Reference:
https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/extensibility/method-wrapping-coc

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
Prollyx
Highly Voted 7 months, 2 weeks ago
1&1 is correct
upvoted 9 times
...
niko_
Most Recent 9 months, 2 weeks ago
Correct is 1 and 1
upvoted 2 times
...
faycal
10 months, 1 week ago
Correct answer is A A
upvoted 3 times
...
Sisb
11 months, 1 week ago
Microsoft gave this kind exam in wrong answer information! Shame of them. The first one is also not 100% correct but it is the most closest correct one. Why they tried to confuse our developers?
upvoted 3 times
kushal095
10 months, 1 week ago
The first one is correct. viking1 explained it below : " Yes, the first option is correct on both questions. The fact that the name does not name the class being extended is not an error. It is non-ideal, but it is the [ExtensionOf] attribute that names the class being extended, not the class name. A class could be extended by multiple models, so it is actually recommended to prefix your extension class name so as to avoid name conflicts. If the first part of the extension class name was enforced to be the same as the class being extended, then a class could only ever be extended once. "
upvoted 3 times
...
...
Pir
1 year, 10 months ago
First question has no option as correct. But all best practices use a word, "should", not "must". So first choice is incorrect because, it does not completely name the class it is augmenting, and second choice is wrong because it does not end with _Extension postfix. So any how both are only near option but first one is closest.
upvoted 2 times
Jahve
1 year, 3 months ago
In case of first question exists only one useable solution. Because: Extension of class have to be FINAL and have to have suffix _Extension. So FirstOne souhld be correct
upvoted 6 times
...
viking1
1 year, 4 months ago
Yes, the first option is correct on both questions. The fact that the name does not name the class being extended is not an error. It is non-ideal, but it is the [ExtensionOf] attribute that names the class being extended, not the class name. A class could be extended by multiple models, so it is actually recommended to prefix your extension class name so as to avoid name conflicts. If the first part of the extension class name was enforced to be the same as the class being extended, then a class could only ever be extended once.
upvoted 3 times
...
...
Nano14
1 year, 11 months ago
Microsoft should be ashamed about exam questions like this. Per the linked documentation it could be A or B but should not be either. It should not be A because: "Don't name the extension just <Element that is being extended>_Extension. For example, an extension class that augments the InventLocation table must not be named InventLocation_Extension, because the risk of conflicts is too high." It should not be B because it should always end with _Extension
upvoted 3 times
pinticas
1 year, 6 months ago
It's A, A.
upvoted 4 times
...
...
userAx
2 years, 1 month ago
final class _Extension is wrong as this is MS naming convention, the first answer should be the second choice with _MyExtension
upvoted 3 times
Greemus
2 years ago
you are wrong, class extensions must end with _Extension suffix. https://www.examtopics.com/exams/microsoft/mb-500/
upvoted 17 times
YoungPadawan
2 years ago
Also agree with you
upvoted 1 times
...
Greemus
2 years ago
wrong reference, here is the correct one: https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/extensibility/naming-guidelines-extensions
upvoted 5 times
...
...
Bulhy
1 year, 11 months ago
Greemus is right here. Extension classes must end with the "_Extension" suffix, must be marked as "Final" and last but least be decorated with "extensionOf". So the given solution is correct.
upvoted 6 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