Hello Everyone,
I have created a custom inquiry screen with pagination, which will load the POReceipts by applying a few conditions.
After applying the pagination code records are loaded very fast and working as expected expect the below scenario.
Issue details.
When I filter a grid column, it is filtering and showing only the current page records but the filter is NOT applying to all the records. Could you please help me with this?
Ex: If I have total of 900 records and per page, if it is showing only 25 records.
When I apply a filter to the grid column, it is filtering by taking only 25 records but NOT 900.
When I debug, PXView.MaximumRows is taking 25 records and filtering them.
Sample Pagination Code:
[PXFilterable]
public PXFilteredProcessing<Customer,
FilterDAC,
Where<Customer.bAccountID, Equal<Current<FilterDAC.customerID>>, Or<Current<FilterDAC.customerID>, IsNull>>> Records;
public IEnumerable records()
{
PXSelectBase<Customer> cmd = new PXSelectJoinGroupBy<Customer,
InnerJoin<ARInvoice, On<ARInvoice.customerID, Equal<Customer.bAccountID>>>,
Where2<Where<Customer.bAccountID, Equal<Current<FilterDAC.customerID>>, Or<Current<FilterDAC.customerID>, IsNull>>,
And<ARInvoice.docDate, Equal<Current<FilterDAC.invoiceDate>>>>,
Aggregate<GroupBy<Customer.acctCD>>>(this);
int startRow = PXView.StartRow;
int totalRows = 0;
foreach (PXResult<Customer, ARInvoice> row in cmd.View.Select(new[] { Filter.Current }, null, PXView.Searches,
PXView.SortColumns, PXView.Descendings, PXView.Filters, ref startRow, PXView.MaximumRows, ref totalRows))
{
Customer cust = (Customer)row;
var existingRow = (Customer)Records.Cache.Locate(cust);
yield return existingRow ?? (Customer)row;
}
PXView.StartRow = 0;
}
Best answer by Naveen Boga
View original