Modifica

Condividi tramite


Queries in the Acceptance test library

Note

Community interest groups have now moved from Yammer to Microsoft Viva Engage. To join a Viva Engage community and take part in the latest discussions, fill out the Request access to Finance and Operations Viva Engage Community form and choose the community you want to join.

A query class provides fluent APIs that you use to find an instance of the corresponding entity based on various criteria. Use query classes in validation scenarios. Use them together with specifications.

Naming convention

AtlQuery<ModuleName><EntityNamePlural>

In this naming convention:

  • <ModuleName> is optional. Use the names of the modules on the main menu. Use a short version or an abbreviation to keep the test code brief.
  • <EntityNamePlural> is the plural version of the entity name.

Examples

AtlQueryWHSLoadLines

AtlQueryInventTransferOrderLines

Implementation

All query classes inherit from the AtlQuery class.

Fluent setters

Query classes should provide fluent setter methods to specify ranges for the query.

Example

loadLine = data.whs().loadLines().query().forSalesOrder(salesOrder).single();

Queries include two types of fluent setter methods: for methods and with methods:

  • for – Use these methods for filters in the query that act as parents in composition or aggregation relationships. For example, the sales lines query exposes a for method to filter sales lines for a specific sales order.
  • with – Use these methods for all other ranges in the query.

Naming convention

for<QueryRangeName>

with<QueryRangeName>

In this naming convention, <QueryRangeName> is the name of the field that the range applies to.

Examples

loadLine = data.whs().loadLines().query().forLoad(load).withInventQty(10).single();

transferLine = data.invent().transferOrderLines().query().forTransferOrder(transferOrder).withInventDims([batch1]).single();