MB-820

MB-820 Develop by Using AL Practice Questions

Develop by using AL (15-20%)

10 questions covering this official MB-820 domain.

Q01 - Question

In an AL procedure you must store a set of values in memory and retrieve each value by a unique identifier that you define, and some of the stored values are themselves lists of text. The number of identifiers is not known when you write the code. Which collection type should you declare?

Domain: Develop by using AL (15-20%) Type: Single choice

D is correct.

Explanation: A Dictionary uses unique keys to retrieve values, and its values can be lists or other dictionaries, which matches a lookup by identifier where each value is a list of text.

A is incorrect: An Array is one-indexed but has fixed declared dimensions, so it cannot grow to an unknown number of entries and it is addressed by position, not by a key you define.

B is incorrect: A List is a dynamic collection of fundamental types, so it does not provide retrieval by a unique key.

C is incorrect: A Record variable represents rows for a particular table and is not an in-memory collection keyed by values you define in code.

Learn more in Microsoft Learn

Q02 - Question

A procedure receives an interface variable. Some implementations also support an additional interface, and others do not. You must call the additional capability without causing a runtime error. What should you do?

Domain: Develop by using AL (15-20%) Type: Single choice

D is correct.

Explanation: Use is to test whether an interface or Variant supports another interface, then use as to cast to it. Testing first is a defensive pattern because a failed as cast raises a runtime error.

A is incorrect: A failed as cast raises a runtime error instead of returning a result you can evaluate.

B is incorrect: The cast runs before the test, so the runtime error occurs before is can report anything.

C is incorrect: Separate parameters for each concrete object reintroduce dependencies on implementations and defeat the purpose of the interface parameter.

Learn more in Microsoft Learn

Q03 - Question

A customer wants a customized report to run instead of a standard Dynamics 365 Business Central report whenever users start it from a page action, from Tell Me, or when code invokes the report. Extending the existing report is not sufficient for the requirement. What should you implement?

Domain: Develop by using AL (15-20%) Type: Single choice

D is correct.

Explanation: Subscribing to ReportManagement.OnAfterSubstituteReport and assigning NewReportId for the target ReportId substitutes the report, and the event is raised for page actions, Tell Me, and report invocation methods.

A is incorrect: Setting UsageCategory to None only removes the standard report from Tell Me results and does not affect page actions or calls from code.

B is incorrect: Additional search terms change how users find an object, not which report runs when the standard report is called.

C is incorrect: A report extension directly extends an existing report and can avoid substitution in some cases, but it does not meet a requirement that extension alone cannot satisfy.

Learn more in Microsoft Learn

Q04 - Question

Your AL code stores item numbers in a List of Text. A duplicate value exists in the list, and you must delete only the entry at position 3. Which method do you use?

Domain: Develop by using AL (15-20%) Type: Single choice

A is correct.

Explanation: RemoveAt deletes the element at the index that you pass, so you can target position 3 without depending on the value.

B is incorrect: Remove deletes the first element that matches the value, which can delete the wrong entry when duplicates exist.

C is incorrect: Contains only reports whether the list holds a value and does not delete anything.

D is incorrect: Reverse changes the order of the elements and does not delete an element.

Learn more in Microsoft Learn

Q05 - Question

You write AL code that packs a total quantity of Integer units into boxes of a fixed size. You must calculate the number of full boxes and the number of units left over, and both results must be integers. Which operators should you use?

Domain: Develop by using AL (15-20%) Type: Single choice

B is correct.

Explanation: DIV returns the integer quotient of a division, which gives the number of full boxes, and MOD returns the remainder, which gives the units left over.

A is incorrect: The / operator performs a standard division and does not return the integer quotient that DIV provides.

C is incorrect: The roles are reversed, because MOD returns the remainder and DIV returns the integer quotient.

D is incorrect: The conditional ? : operator selects one of two values based on a condition, so it does not perform the arithmetic needed here.

Learn more in Microsoft Learn

Q06 - Question

A notification must let the user start a correction routine directly from the notification bar. Where must the method that runs from the notification action be placed, and which function connects it?

Domain: Develop by using AL (15-20%) Type: Single choice

B is correct.

Explanation: AddAction adds an action to the notification, and the action runs a method in a codeunit.

A is incorrect: SetData stores text data on the notification; it does not create an action, and the action method is not taken from the page object.

C is incorrect: Send displays the notification and does not attach the method that runs when the user selects an action.

D is incorrect: GetData reads the stored text values inside the handler; it does not define where the action runs.

Learn more in Microsoft Learn

Q07 - Question

A customer requires that a calculated charge is always rounded upward to two decimals, even when the third decimal is low. Which Round call meets the requirement?

Domain: Develop by using AL (15-20%) Type: Single choice

D is correct.

Explanation: The direction parameter '>' rounds the value upward, and the precision parameter 0.01 sets rounding to two decimals.

A is incorrect: When you omit the direction, Round uses nearest rounding, so low third decimals round downward.

B is incorrect: The '<' direction rounds the value downward, which is the opposite of the requirement.

C is incorrect: The '=' direction rounds to the nearest value, so the result is not always rounded upward.

Learn more in Microsoft Learn

Q08 - Question

A developer must warn users about a missing setup value when a page opens. The warning must not stop the user from continuing to work on the page. Which interaction meets this requirement?

Domain: Develop by using AL (15-20%) Type: Single choice

C is correct.

Explanation: Notifications are small, non-modal alternatives to blocking interactions, so the user sees the warning and can keep working on the page.

A is incorrect: Error stops execution and forces the user to resolve the condition before continuing, which blocks the work you want to allow.

B is incorrect: Message shows a modal dialog that the user must close before continuing.

D is incorrect: Confirm is a blocking interaction that waits for a user response before code continues.

Learn more in Microsoft Learn

Q09 - Question

In AL, you hold a JsonToken that contains a JSON object with a property named city. You must read the text stored in that property. Which sequence of members do you use?

Domain: Develop by using AL (15-20%) Type: Single choice

A is correct.

Explanation: Convert the token to a JsonObject with AsObject, retrieve the named property with Get, and then convert the returned token to a JsonValue with AsValue so you can read the stored data.

B is incorrect: AsArray targets JSON arrays rather than named properties, and Add writes data into a JSON structure instead of reading it.

C is incorrect: ReadFrom parses JSON text into a JSON type, so it is used when you load a response, not when you read a property from a token you already have.

D is incorrect: Add inserts a property into a JSON structure, so it changes the data rather than returning the existing value.

Learn more in Microsoft Learn

Q10 - Question

You plan to publish an extension that substitutes a standard report in a production environment where other extensions are already installed. Which action helps you avoid conflicting or failing behavior after deployment?

Domain: Develop by using AL (15-20%) Type: Single choice

A is correct.

Explanation: Another subscriber can already assign a NewReportId for the same report, so check for an existing substitution, and confirm that the replacement report works for the code that invokes it.

B is incorrect: Changing UsageCategory affects only Tell Me results and does not control which report runs from page actions or from code.

C is incorrect: Matching captions are preferred where appropriate so that linked actions and bookmarks stay consistent.

D is incorrect: Substitution works by redirecting the call at run time through the OnAfterSubstituteReport event, so the base report remains in the environment.

Learn more in Microsoft Learn

Take the full MB-820 practice test · Read the MB-820 study guide