MB-820 Dumps

MB-820 Free Practice Test

Microsoft MB-820: Microsoft Dynamics 365 Business Central Developer

QUESTION 21

HOTSPOT - (Topic 4)
You create an 'AddltemsToJson" procedure and publish it.
MB-820 dumps exhibit
The procedure fails to run.
You need to fix the errors in the code.
For each of the following statements, select Yes if the statement is true. Otherwise, select No.
MB-820 dumps exhibit
Solution:
✑ In line 13, replace the Add method with Insert. = NO
✑ In line 15, replace the WriteTo method with ReadFrom. = NO
✑ Change the ItemObject variable type from JsonObject to JsonToken. = NO
✑ Move line 08 in the beginning of REPEAT .. UNTIL. = YES
The provided code is intended to serialize a list of items from the Item table into a JSON array format. Here is a breakdown of the code and the necessary corrections:
✑ In line 13, "ItemsArray.Add(ItemObject)": This line is correctly using the Add
method to add the ItemObject to the ItemsArray. The Add method is the correct method to use for adding items to a JsonArray. Therefore, there is no need to replace Add with Insert.
✑ In line 15, "ItemsArray.WriteTo(RequestText)": The WriteTo method is used
correctly to serialize the ItemsArray into a JSON formatted string and store it in the RequestText variable. The ReadFrom method is used for the opposite operation, i.e., to deserialize a JSON formatted string into a JsonArray, which is not the goal in this context. Hence, no change is needed here.
✑ Change the ItemObject variable type from JsonObject to JsonToken: The
ItemObject variable is intended to hold JSON objects representing individual items, making JsonObject the appropriate type. JsonToken is not a type used in this context within AL for Business Central, and thus the variable type should remain as JsonObject.
✑ Move line 08, "Clear(ItemObject)": This line should be moved inside the repeat
loop to ensure that the ItemObject is cleared for each item in the loop. Placing it before the repeat would only clear it once before the loop starts, which could lead to incorrect serialization as the previous item's properties would not be cleared from the ItemObject.
The logic for serializing records into JSON is a common operation when interfacing with APIs or web services in Business Central, and the pattern shown in the code is typical for such operations.

Does this meet the goal?

Correct Answer: A

QUESTION 22

HOTSPOT - (Topic 4)
You need to use a query data type to retrieve requited data.
How should you complete the code' To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
MB-820 dumps exhibit
Solution:
You are retrieving data using a query data type. The following code snippet needs to be completed:
✑ If QueryA...: The correct option here is Open. This opens the query and prepares it
for data retrieval.
✑ While QueryA...: The correct option here is Read. This reads through the query
results one row at a time.
✑ If QueryA...: Open
✑ While QueryA...: Read

Does this meet the goal?

Correct Answer: A

QUESTION 23

HOTSPOT - (Topic 4)
You create a table with fields. You observe errors in the code You need to resolve the errors.
MB-820 dumps exhibit
For each of the following statements, select Yes if the statement is true. Otherwise, select No.
NOTE: Each correct selection is worth one point.
MB-820 dumps exhibit
Solution:
✑ In line 12, declare "Job Task" as a variable. = NO
✑ Add the property FieldClass = FlowField; for field 3. = YES
✑ Add the property FieldClass = FlowFilter; for field 3. = NO
✑ In line 23, assign the "User Setup" table to a field. = YES
For "In line 12, declare 'Job Task' as a variable": In the AL code provided, the "Job Task" appears to be part of a CalcFormula of a FlowField, which means it references a table and not a variable. The "Job Task" does not need to be declared as a variable because it is used to reference a table in a CalcFormula expression.
For "Add the property FieldClass = FlowField; for field 3": The line of code CalcFormula = sum("Job Task"."Recognized Sales Amount" where("Job No." = field("No."))); indicates that this field is calculated from other table data, which is the definition of a FlowField. Therefore, adding the property FieldClass = FlowField; is necessary for the field to function correctly.
For "Add the property FieldClass = FlowFilter; for field 3": FlowFilters are used to filter data based on the value in a flow field. Since field 3 is using a CalcFormula to sum values, it is a FlowField and not a FlowFilter. Therefore, this statement is not correct.
For "In line 23, assign the 'User Setup' table to a field": The line TableRelation = "User Setup"; suggests that the "Project Manager" field has a relation to the "User Setup" table, which is a method of assigning a table to a field to ensure that the values in "Project Manager" correspond to values in the "User Setup" table. Hence, this statement is true.

Does this meet the goal?

Correct Answer: A

QUESTION 24

- (Topic 4)
You plan to write unit test functions to test newly developed functionality in an app. You must create a test codeunit to write the functions.
You need to select the property to use for the test codeunit.
Which property should you use to ensure that the requirements are fulfilled?

Correct Answer: A
When creating a test codeunit in Microsoft Dynamics 365 Business Central to write unit test functions, the SubType property (A) of the codeunit should be set to Test. This property is crucial for defining the codeunit's purpose and behavior within the application. By setting the SubType property to Test, you are indicating that the codeunit contains test functions intended to validate the functionality of other parts of the application, such as customizations or new developments. This distinction ensures that the testing framework within Business Central recognizes the codeunit as a container for test functions, allowing it to execute these functions in a testing context, which can include setting up test data, running the tests, and cleaning up after the tests have completed.

QUESTION 25

HOTSPOT - (Topic 2)
You need to log an error in telemetry when the business process defined in the custom application developed for Contoso, Ltd fails.
How should you complete the code segment? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
MB-820 dumps exhibit
Solution:
Verbosity::Critical: This ensures that the telemetry logs the failure as a critical event. DataClassification::CustomerContent: This helps classify the error as related to customer data.
TelemetryScope::All: This ensures that the error is visible across all relevant telemetry scopes, making it easier to monitor the issue in real-time.

Does this meet the goal?

Correct Answer: A