This document describes the PX1010 diagnostic.
Code | Short Description | Type | Code Fix |
---|---|---|---|
PX1010 | If a delegate applies paging in an inner select, StartRow must be reset. (If StartRow is not reset, paging will be applied twice.) |
Warning (ISV Level 1: Significant) | Available |
If a delegate applies paging in an inner select, PXView.StartRow
must be set to 0. If StartRow
is not reset, paging is applied twice.
The code fix adds PXView.StartRow = 0;
before the return from the delegate. This code fix supports multiple return
statements.
For iterator methods, the warning message is shown but the code fix is not available.
public class LEPMaint : PXGraph<LEPMaint>
{
public PXSelect<ListEntryPoint> Items;
public IEnumerable items()
{
int startRow = PXView.StartRow;
int totalRows = 0;
IEnumerable<ListEntryPoint> rows = new PXView(this, false, new Select<ListEntryPoint>()) // The PX1010 warning is displayed for this line.
.Select(PXView.Currents, PXView.Parameters, PXView.Searches, PXView.SortColumns, PXView.Descendings, PXView.Filters,
ref startRow, PXView.MaximumRows, ref totalRows).Cast<ListEntryPoint>();
return rows;
}
}
public class LEPMaint : PXGraph<LEPMaint>
{
public PXSelect<ListEntryPoint> Items;
public IEnumerable items()
{
int startRow = PXView.StartRow;
int totalRows = 0;
IEnumerable<ListEntryPoint> rows = new PXView(this, false, new Select<ListEntryPoint>())
.Select(PXView.Currents, PXView.Parameters, PXView.Searches, PXView.SortColumns, PXView.Descendings, PXView.Filters,
ref startRow, PXView.MaximumRows, ref totalRows).Cast<ListEntryPoint>();
PXView.StartRow = 0;
return rows;
}
}