This document describes the PX1015 diagnostic.
| Code | Short Description | Type | Code Fix |
|---|---|---|---|
| PX1015 | For a BQL statement that contains parameters, the number of arguments of a Select method is different from the number of parameters. |
Warning (ISV Level 1: Significant) | Unavailable |
For BQL statements that contain Required and Optional parameters, a Select method must have a number of arguments that satisfies both of the following requirements:
- The number of arguments is equal to or greater than the number of
Requiredparameters in the BQL statement. - The number of arguments is equal to or less than the number of
RequiredandOptionalparameters in the BQL statement.
To fix the issue, you should check whether all necessary arguments are passed to the method.
The diagnostic supports the following method calls:
- The family of
Selectmethods, such asSelect,SelectSingleBound, andSelectWindowed, of the standardPXSelectclasses - The family of
Searchmethods of the standardPXSelectclasses - The
Updatemethod of thePXUpdateclasses - The static
Selectmethod of BQL classes derived from the standardPXSelectclasses
The diagnostic does not support the following situations:
- If the
Selectmethod is called for an instance of a BQL class derived from a standardPXSelectclass - If a BQL statement is constructed dynamically (that is, with the methods such as
WhereAndandCompose) - If a BQL statement or the arguments passed to the
Selectmethod cannot be analyzed at compile time
public class SOOrdersInq : PXGraph<SOOrdersInq>
{
public PXSelect<SOOrder,
Where<SOOrder.orderType, Equal<Required<SOOrder.orderType>>,
And<SOOrder.status, Equal<Required<SOOrder.status>>>>,
OrderBy<
Asc<SOOrder.orderNbr>>> Orders;
private IEnumerable GetOrders()
{
var result = Orders.Select(); // The PX1015 warning is displayed for this line.
//You need to specify the values of two required parameters in the arguments.
return result;
}
}