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
Required
parameters in the BQL statement. - The number of arguments is equal to or less than the number of
Required
andOptional
parameters 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
Select
methods, such asSelect
,SelectSingleBound
, andSelectWindowed
, of the standardPXSelect
classes - The family of
Search
methods of the standardPXSelect
classes - The
Update
method of thePXUpdate
classes - The static
Select
method of BQL classes derived from the standardPXSelect
classes
The diagnostic does not support the following situations:
- If the
Select
method is called for an instance of a BQL class derived from a standardPXSelect
class - If a BQL statement is constructed dynamically (that is, with the methods such as
WhereAnd
andCompose
) - If a BQL statement or the arguments passed to the
Select
method 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;
}
}