MB-500: Microsoft Dynamics 365: Finance and Operations Apps Developer

MB-500: Microsoft Dynamics 365: Finance and Operations Apps Developer

Question

You are a Dynamics 365 Finance developer.

You create an integer variable named totalSales.

You need to display the value from totalSales in an info statement.

Which three code segments can you use? Each correct answer presents a complete solution.

NOTE: Each correct selection is worth one point.

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D. E.

ACD.

A: int2Str converts an integer to the equivalent string.

C: any2Str converts an anytype value to a str value.

The anytype data type is a placeholder for any data type.

D: Example: void MyMethod() { for (int i = 0; i < 10; i++) { info(strfmt("i is %1", i)); } } Reference: https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/dev-ref/xpp-variables-data-types https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/dev-ref/xpp-data-primitive#anytype.

Sure, I can help you with that.

Out of the given code segments, you can use the following three code segments to display the value from totalSales in an info statement:

A. info(int2str(totalSales)); B. info(totalSales); D. info(strfmt("%1", totalSales));

Here's a detailed explanation of each of these code segments:

A. info(int2str(totalSales)); This code segment uses the int2str function to convert the integer variable totalSales to a string, and then passes the resulting string to the info function, which displays it in an info statement. This code segment is a correct solution.

B. info(totalSales); This code segment directly passes the integer variable totalSales to the info function, which automatically converts it to a string and displays it in an info statement. This code segment is a correct solution.

C. info(any2str(totalSales)); This code segment uses the any2str function to convert the integer variable totalSales to a string, and then passes the resulting string to the info function, which displays it in an info statement. However, since totalSales is already an integer, it is not necessary to use the any2str function to convert it to a string. This code segment is not necessary.

D. info(strfmt("%1", totalSales)); This code segment uses the strfmt function to format the integer variable totalSales as a string with the format specifier "%1", and then passes the resulting string to the info function, which displays it in an info statement. This code segment is a correct solution.

E. info(strLine(totalSales, 1)); This code segment uses the strLine function to create a string consisting of totalSales followed by a line break, and then passes the resulting string to the info function, which displays it in an info statement. However, since the question does not specify that a line break is necessary, this code segment is not necessary.

I hope that helps!