MB-500 · Question #343
You use Dynamics 365 Finance. You loop through a list of vendor records filtered by the vendor group number. You want to store the vendor account number in a container that will be used later. You…
The correct answer is C. VendTable vendTable; container vendorAccounts; int currentPosition = 1; while select vendTable where vendTable.VendGroup == '10' { vendorAccounts = conIns(vendorAccounts, currentPosition, vendTable.AccountNum); currentPosition++; }. The first element of the container is specified by the number 1. Use CurrentPosition = 1. Use conIns, not conPeek. conIns returns a value so use VendorAccount = conIns.. Use currentPosition++ in the loop. Not A: The first element of the container is specified by the number, not…
Question
Exhibits
Options
- AVendTable vendTable; container vendorAccounts; int currentPosition = 0; while select vendTable where vendTable.VendGroup == '10' { vendorAccounts = conIns(vendorAccounts, currentPosition, vendTable.AccountNum); currentPosition++; }
- BVendTable vendTable; container vendorAccounts; int currentPosition = 1; while select vendTable where vendTable.VendGroup == '10' { conIns(vendorAccounts, currentPosition, vendTable.AccountNum); currentPosition++; }
- CVendTable vendTable; container vendorAccounts; int currentPosition = 1; while select vendTable where vendTable.VendGroup == '10' { vendorAccounts = conIns(vendorAccounts, currentPosition, vendTable.AccountNum); currentPosition++; }
- DVendTable vendTable; container vendorAccounts; int currentPosition = 1; while select vendTable where vendTable.VendGroup == '10' { vendorAccounts = conIns(vendorAccounts, currentPosition, vendTable.AccountNum); }
- EVendTable vendTable; container vendorAccounts; int currentPosition = 1; while select vendTable where vendTable.VendGroup == '10' { vendorAccounts = conPeek(vendorAccounts, currentPosition, vendTable.AccountNum); currentPosition++; }
How the community answered
(38 responses)- A11% (4)
- B3% (1)
- C82% (31)
- E5% (2)
Explanation
The first element of the container is specified by the number 1. Use CurrentPosition = 1. Use conIns, not conPeek. conIns returns a value so use VendorAccount = conIns.. Use currentPosition++ in the loop. Not A: The first element of the container is specified by the number, not 0. Not B: conIns return value is a new container that contains the inserted elements. Not D: No currentPosition++ in the loop Not E: Use conIns, not conPeek. Retrieves a specific element from a container and converts it into another data type, if conversion Note: conIns, conPeek X++ container runtime functions These functions manipulate the contents of containers. Inserts one or more elements into a container. A new container that contains the inserted elements. The first element of the container is specified by the number 1. To insert after the n element, the start parameter should be n+1. You can also use the += operator to add values of any type to a container. For example, to create a container that contains the squared values of the first 10 loop iterations, use the following code. for (i = 1; i < = 10; i++) container conIns (container container, int start, anytype element, ... ) static void conInsExample(Args _arg) c = conIns(c,1,"item1"); c = conIns(c,2,"item2"); for (i = 1 ; i <= conLen(c) ; i++) // Prints the content of a container. print conPeek(c, i); https://learn.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/dev-ref/xpp-container-run- https://learn.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/dev-ref/xpp-data/xpp-while-
Topics
Community Discussion
No community discussion yet for this question.




