Q:
For a new module in Microsoft Dynamics 365 finance and operations apps, you need to ensure that certain operations are performed only if specific conditions are met within the data retrieved by a query.
You need to apply filtering logic to the query results based on dynamic conditions.
What should you do?
-
A
Retrieve all records and then use an if-else block in X++ to filter the results programmatically.
-
B
Create multiple versions of the query; one for each set of conditions, and execute them conditionally.
-
C
Implement X++ variable scoping and use the QueryFilter class to add conditional filters to the query.
-
D
Hard-code the filter conditions directly into the select statement of the query.
C
Answer:
C
Explanation:
Rationale: The correct method to apply filtering logic to the query results based on dynamic conditions is to implement X++ variable scoping and use the QueryFilter class to add conditional filters to the query, making option C correct. Option A is incorrect as it is inefficient to retrieve all records first and then filter them programmatically. Option B, which suggests creating multiple versions of the query for each set of conditions, is incorrect as it is not efficient and does not leverage the capabilities of the QueryFilter class. Hard-coding the filter conditions directly into the select statement of the query (Option D) is incorrect as it lacks flexibility and does not support dynamic filtering.
Implement Chain of Command - Training | Microsoft Learn
Class extension - Method wrapping and Chain of Command - Finance & Operations | Dynamics 365 | Microsoft Learn
Related Topic:
Share Above MCQ