Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Microsoft MB-820 Exam - Topic 4 Question 46 Discussion

Posted by Reita on May 05, 2026 at 01:28 AM

You need to create the access modifier for IssueTotal.

Which variable declaration should you use?

Suggested Answer: B

In Business Central development using AL (the language for Business Central extensions), the use of access modifiers defines how variables and procedures are accessed within and outside of an object or codeunit.

Access Modifiers in AL:

Public: A public variable can be accessed from any object or codeunit within the same module or extension.

Protected: This restricts access to the current object and objects that inherit from the current object. However, in AL (at least in versions used for Business Central), the Protected access modifier is used with methods but not variables.

Internal: This modifier restricts the visibility to the current extension. This means that variables or methods declared as internal can only be accessed from within the same extension. This is appropriate when you want to provide functionality that is shared within the extension but not exposed externally.

Local: This restricts the variable or method to the current object or method where it is declared. It cannot be accessed from anywhere else, even within the same extension.

Scenario Justification:

In the scenario for Contoso, Ltd., IssueTotal is a global variable in the ISSUE BASE extension, and the ISSUE EXT extension needs to access it. Therefore, the variable cannot be declared as Local, because this would restrict access to just the current object (or method).

Using Public would expose the variable outside of the extension, which is unnecessary because you only want other parts of the extension (specifically the ISSUE EXT extension) to have access.

The best choice in this case is Internal because it restricts access to the variable to within the same extension, which includes the base extension and any dependent extensions like ISSUE EXT. It strikes the right balance between visibility and encapsulation.

Microsoft Dynamics 365 Business Central Developer Reference:

Access Modifiers in AL: Microsoft's documentation on AL provides the details on access modifiers, where it is specified that internal variables can be accessed within the extension, and the public variable is accessible across all extensionssource: Microsoft Learn on AL Programming.

Best Practices for AL Development: Business Central development best practices suggest keeping variables internal unless they need to be accessed outside of the current extensionsource: Microsoft Learn on AL development guidelines.


Get Premium MB-820 Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
24 comments · newest first
CH
Chun 5 days ago
I think C is the best choice. Public access is essential.
OM
Omer 10 days ago
E is incomplete, can't use that.
EL
Elly 15 days ago
D is not suitable for this scenario.
GR
Graciela 20 days ago
B is too restrictive for most cases.
LI
Lizette 25 days ago
A could work too, but it's limited to subclasses.
MI
Michael 1 month ago
I agree, C makes it accessible everywhere.
MI
Miles 1 month ago
I think C is the best choice. Public access is essential.
JE
Jettie 1 month ago
Exactly! We need it to be widely accessible.
LA
Lai 2 months ago
Public allows for flexibility in usage.
DO
Dorathy 2 months ago
E is incomplete. Missing access modifier.
TH
Thea 2 months ago
D is too restrictive. Local variables can't be accessed outside.
IL
Ilene 2 months ago
But B is limited to the current assembly. Not ideal.
CA
Candra 2 months ago
A could work too. Protected is useful for subclasses.
JE
Jettie 2 months ago
I agree, C makes it accessible everywhere.
LA
Lai 3 months ago
I think C is the best choice. Public access is essential.
CL
Cletus 3 months ago
Wait, is D even a valid option?
FI
Filiberto 3 months ago
I’d go with B for internal use.
LU
Luis 3 months ago
Public makes sense, but is it really necessary?
KR
Kristin 3 months ago
A seems too restrictive for this case.
FE
Felicidad 3 months ago
I think C is the best choice for access.
SO
Sommer 4 months ago
"Local" doesn't seem right since it usually refers to variables within a method, but I can't remember if "var" is even a valid declaration here.
JO
Jody 5 months ago
I feel like "internal" might be the right choice since it limits access to the same assembly, but I could be mixing it up with another concept.
LY
Lynelle 5 months ago
I practiced a similar question where "public" was the right answer for broader access, but I can't recall if that's the case for this one too.
LE
Leslie 6 months ago
I think I remember that "protected" allows access within the same class and subclasses, but I'm not sure if that's the best choice here.
0/2000 characters

Save Cancel