MB-820 practice question 13 of 25

You need to create the access modifier for IssueTotal. Which variable declaration should you use?

Full set: 116 questions

Domain Configure Microsoft Dynamics 365 Business Central

Answer options
A: Protected vat IssueTotal: Decimal
B: Internal var IssueTotal: Decimal Correct answer
C: Public var IssueTotal: Decimal
D: Local var IssueTotal: Decimal
E: Var IssueTotal; Decimal
Correct Answer:
B. Internal var IssueTotal: Decimal
Explanation

The Internal access modifier restricts the accessibility of a variable to the AL code within the same module or extension. This is the correct choice for creating a variable that should be accessible across different objects (like codeunits or pages) within the same app but should not be exposed to other extensions. The syntax in the option correctly identifies Internal as a valid modifier for a variable declaration.

Why Incorrect

A. The keyword vat is a syntax error; the correct keyword for variable declaration is var.
C. Public is not a valid access modifier for variable declarations in the AL language. It is used for procedures.
D. Local is the default scope for variables declared inside a procedure and is not used as an explicit modifier in a global variable declaration.
E. This option has incorrect syntax. A colon (:) must separate the variable name and its data type, not a semicolon (;).

References

1. Microsoft Learn: Method and variable access modifiers. This document explicitly lists the valid access modifiers for variables in AL. It confirms that Internal and Protected are valid for variables, while Public is not.

Reference Section: The table under "Accessibility Levels" shows that Internal is "Only accessible from code in the same module".

2. Microsoft Learn: Variables. This document outlines the basic syntax for declaring variables. It shows the standard declaration format is var : ;, confirming that options A and E have incorrect syntax.

Reference Section: "Declaring Variables".

Scroll to Top