Microsoft Dynamics 365 Business Central Developer - MB-820 Exam Practice Test

Question 1
You are writing a procedure to block all inventory items with numbers that do not start with the letter S.
You need to complete the procedure.
How should you complete the code expressions? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
Correct Answer:

Explanation:

procedure BlockNonSItems()
var
Item: Record Item;
begin
// Reset the Item record to clear any previous filters.
Item.Reset();
// Set the filter to exclude items that start with 'S'.
Item.SetFilter("No.", '<>%1*', 'S');
// Find each item that matches the filter.
if Item.FindSet() then
repeat
// Set the Blocked field to true to block the item.
Item.Blocked := true;
// Save the changes to the Item record.
Item.Modify();
until Item.Next() = 0; // Continue until no more items are found.
end;
Question 2
A company owns and operates hotels, restaurants, and stores.
When the staff orders materials from the purchasing department, the requests are not directed to the correct approvers.
The staff requires a new field named Approver from which they can select the appropriate approver. The field must include the following options:
* Hotel manager
* Restaurant manager
* Store manager
* Purchasing manager
You need to create the Approver field in the Item table by using an AL extension.
Which three actions should you perform in sequence? To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order.
Correct Answer:

Explanation:
Create an enum object named Approver and include all options.
* Reasoning: First, you must define the set of options (Hotel manager, Restaurant manager, etc.). In modern AL development, Enums are the standard way to create option sets because they are extensible.
Create a table extension object for an Item table with an Approver field of enum type named Approver in the field section.
* Reasoning: Next, you need to add the actual data field to the database. Since the "Item" table is a standard base table, you use a table extension. Tables use a fields section to define data columns. You reference the Enum created in step 1 here.
Create a page extension object that extends the Item Card object. Add the field to the layout section.
* Reasoning: Finally, to allow users to see and edit this new field on the screen, you must extend the
"Item Card" page. Pages use a layout section to determine where controls appear.
Question 3
You have a column in a report.
You receive the following warning from CodeCop:
"Field 'Home Page' is marked for removal. Reason: Field length will be increased to 255.. AL(AL0432)" You have the following code:
1 column(CompanyHomePage; CompanyInformation."Home Page")
2 {
3 }
For each of the following statements, select Yes if the statement is true, Otherwise, select No.
NOTE: Each correct selection is worth one point.
Correct Answer:

Explanation:
1. Create a custom Home Page field for the Company information table.
* Selection: No
* Reasoning: Creating a custom field (e.g., 50000 "My Home Page") creates a disconnected data silo.
The standard application uses the standard "Home Page" field. If you create a custom one, it will be empty unless you write additional code to sync it, and it won't be populated by standard pages. The correct approach is to either use the replacement standard field (if one exists) or suppress the warning until you can refactor.
2. Enclose Line 1 within #pragma warning disable AL0432 .. #pragma warning restore AL0432.
* Selection: Yes
* Reasoning: This is the standard, correct "Code update" to manage specific deprecation warnings (AL0432). It allows you to continue using the field temporarily (e.g., during a transition period while the field is Obsolete: Pending) without breaking the build, and it limits the suppression strictly to the lines of code that require it, rather than blinding the entire project to deprecations.
3. Disable the AL0432 rule in the ruleset.
* Selection: No
* Reasoning: While this technically stops the warning from appearing, it is considered bad practice.
Disabling the rule in ruleset.json suppresses AL0432 for the entire project, meaning you might miss other critical deprecation warnings that you actually need to address. It is a configuration change, not a focused "code update" to manage a specific warning.
4. Remove or comment the column and then put it back after the field length is increased.
* Selection: No
* Reasoning: Removing or commenting out the column breaks the report functionality immediately (the data will disappear from the report). Furthermore, relying on "putting it back later" is not a valid strategy for continuous development; you need the code to work now. If the field is marked for removal, it may not exist "later" in its current form, so simply uncommenting it in the future might fail entirely.
Question 4
You create the following Vendor table and Item table in Business Central.

You require the following data set to assign vendors to items.

You need to create a query to assign the vendors.

Which three code blocks should you use to develop the solution? To answer, move the appropriate code blocks from the list of code blocks to the answer area and arrange them in the correct order.
NOTE: More than one order of answer choices is correct. You will receive credit for any of the correct orders you select.
Correct Answer:

Explanation:
dataitem(Item; Item)
SqlJoinType = InnerJoin;
DataItemLink = "Vendor No." = Vendor.Vendor_No;
Question 5
You create a Business Central report.
You need to insert values on the Request page to be saved for the next time the report is run.
What should you do?

Correct Answer: C
Question 6
A developer creates a profile for part-time shop supervisors and adds customizations.
You plan to add new requirements to the profile.
You need to analyze the code to understand the profile and make sure there are no errors.

For each of the following statements, select Yes if the statement is true. Otherwise, select No.
NOTE: Each correct selection is worth one point.
Correct Answer:

Explanation:
The Part Time Shop Supervisor profile will be applied only to users with "Register Time" = true on User Setup: No Variables, procedures, and triggers cannot be added on page customization objects: Yes Line 10 should use extends instead of customizes: No In line 18, "Unit Cost" will be moved after "Costing Method": Yes The Part Time Shop Supervisor profile will be applied only to users with "Register Time" = true on User Setup.
* No
* The code doesn't contain any reference to the User Setup table or the Register Time field, so this is not correct. Profiles are not applied conditionally based on fields like this.
Variables, procedures, and triggers cannot be added on page customization objects.
* Yes
* Page customization objects are meant for UI modifications, such as moving or hiding fields. You cannot add variables, procedures, or triggers in a page customization object.
Line 10 should use extends instead of customizes.
* No
* In AL, when customizing a page within a profile, you use customizes rather than extends. Extends is used when modifying base application objects, but customizes is used to customize pages within a profile.
In line 18, "Unit Cost" will be moved after "Costing Method".
* Yes
* The code in line 18 is correct. The moveafter directive will move the "Unit Cost" field after the " Costing Method" field on the page layout.
Question 7
A company uses Business Central.
The company plans to use the AL object model in Business Central to extend the Base Application.
You need to extend the objects.
Which two objects can you extend? Each correct answer presents a complete solution.
NOTE: Each correct selection is worth one point.

Correct Answer: C,E
Question 8
You are creating a new Business Central report.
You plan to use triggers and functions to dynamically create a dataset and control the report behavior.
You must provide the following implementation.
* Run when the report is loaded.
* Run when the data item is iterated for the last time.
* Skip the rest of the report.
You need to select the triggers and functions for the report.
Which triggers and functions should you use? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
Correct Answer:

Explanation:
* Runs when the report is loaded: OnInitReport
* Runs when the data item has been iterated for the last time: OnPostDataItem
* Use this function to skip the rest of the report: CurrReport.Quit()
1. Requirement: Runs when the report is loaded.
* Selection: OnInitReport
* Reasoning: The OnInitReport trigger is the very first event that fires when the report object is instantiated (loaded). It runs before the request page is displayed, making it the correct choice for
"when the report is loaded."
* Contrast: OnPreReport runs after the request page, just before the data processing starts.
2. Requirement: Runs when the data item has been iterated for the last time.
* Selection: OnPostDataItem
* Reasoning: The OnPostDataItem trigger executes immediately after the report has finished iterating through all records belonging to that specific data item.
* Contrast: OnPreDataItem runs before the loop starts, and OnAfterGetRecord runs repeatedly during the loop (for every record).
3. Requirement: Use this function to skip the rest of the report.
* Selection: CurrReport.Quit()
* Reasoning: The CurrReport.Quit() function completely aborts the execution of the report, effectively
"skipping" everything else remaining in the report logic.
* Contrast: CurrReport.Skip() only skips the current record processing and moves to the next record. CurrReport.Break() exits the current data item loop but proceeds to the next data item (if any) or finishes the report normally.
Question 9
The serial numbers of the non-conformities and the period in which they can be created must be in a configuration table and its corresponding page to allow them to be modified for the users.
You need to create the configuration table and page for the non-conformity functionality.
Which table configurations should you use? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
Correct Answer:

Explanation: