QuestionQ213

Develop and test code

A company uses Dynamics 365 Finance.

You must use QueryBuilder classes to create a query that loops through every customer whose customer group is EXT. You declare and initialize a query object.

You need to execute the query.

In what order should you perform the actions? Move all actions into the answer area and arrange them in the correct sequence.

Drag & Drop
Declare a QueryBuildRange object and add a range for the CustGroup field on the QueryBuildDataSource.
Declare a QueryBuildDataSource object. Call the addDataSource method on the query object and assign it to the QueryBuildDataSource by using CustTable.
Add a value to range for the CustGroup EXT to the QueryBuildRange object.
Loop through the QueryRun object by using the Next method.
Declare and initialize the QueryRun object by using the query object.
Explanation

A QueryBuildDataSource for CustTable must be added to the Query before a range can be added against its CustGroup field. Set the QueryBuildRange value to EXT, then create QueryRun from the completed Query. QueryRun.next() executes iteration through the records that satisfy the range.

Community Discussion

No comments yet. Be the first to start the discussion!