Microsoft
MB-500 · Question #121
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…
The correct answer is B. No. You can safely use "==" numerical operator only on the base enum values (and it is actully used in the standard code pretty often). For the values not from base enum you have no assurance that there is only one extension of this enum, which could mess with the extension value…
Design and develop AOT elements
Question
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. You have an enumeration named truckStatus that has the following statuses: Empty Loaded Completed You have the following code: You need to extend this enumeration and add the following statuses to the enumeration: Quarantine, InTransit. You must then modify code that validates the switch statement. Solution: Add a post handler to the method that checks the enumeration and logic for your new enumeration values using the integer value of the enumeration. Does the solution meet the goal?
Options
- AYes
- BNo
How the community answered
(37 responses)- A27% (10)
- B73% (27)
Explanation
You can safely use "==" numerical operator only on the base enum values (and it is actully used in the standard code pretty often). For the values not from base enum you have no assurance that there is only one extension of this enum, which could mess with the extension value order. https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/extensibility/add-enum-
Topics
#enum extension#enumeration#truckStatus#X++
Community Discussion
No community discussion yet for this question.