Skip to content

Latest commit

 

History

History
56 lines (42 loc) · 3.01 KB

PX1015.md

File metadata and controls

56 lines (42 loc) · 3.01 KB

PX1015

This document describes the PX1015 diagnostic.

Summary

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

Diagnostic Description

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 and Optional 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 as Select, SelectSingleBound, and SelectWindowed, of the standard PXSelect classes
  • The family of Search methods of the standard PXSelect classes
  • The Update method of the PXUpdate classes
  • The static Select method of BQL classes derived from the standard PXSelect 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 standard PXSelect class
  • If a BQL statement is constructed dynamically (that is, with the methods such as WhereAnd and Compose)
  • If a BQL statement or the arguments passed to the Select method cannot be analyzed at compile time

Example of Code that Results in the Warning

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;
    }
}

Related Articles