In the Process Order screen, I have added a custom StringList field to the grid. When I apply a filter on this field in the grid level, the filtering works only for the currently loaded page. If I navigate to the next page, the filter then applies only to those page records, not across all pages.
Could you please suggest the correct approach to make the filter work across all pages/records?
public delegate IEnumerable ordersDelegate();
[PXOverride]
public virtual IEnumerable orders(ordersDelegate basemethod)
{
PXUIFieldAttribute.SetDisplayName<SOOrder.customerID>(Base.Caches[typeof(SOOrder)], Messages.CustomerID);
SOOrderFilter filter = PXCache<SOOrderFilter>.CreateCopy(Base.Filter.Current);
if (filter.Action == PXAutomationMenuAttribute.Undefined)
yield break;
if (_ActionChanged)
Base.Orders.Cache.Clear();
PXSelectBase<SOOrder> cmd = GetSelectCommand(filter);
AddCommonFilters(filter, cmd);
int startRow = PXView.StartRow;
int totalRows = 0;
Dictionary<int?, Dictionary<int?, decimal?>> stockleveldict = new Dictionary<int?, Dictionary<int?, decimal?>>();
foreach (PXResult<SOOrder> res in cmd.View.Select(null, null, PXView.Searches, PXView.SortColumns, PXView.Descendings, PXView.Filters, ref startRow, PXView.MaximumRows, ref totalRows))
{
SOOrder order = res;
SOOrder cached;
if ((cached = (SOOrder)Base.Orders.Cache.Locate(order)) != null)
{
order.Selected = cached.Selected;
}
if (filter?.Action == WellKnownActions.SOOrderScreen.CreateShipment)
{
order = DisplayStatus(order, stockleveldict);
Base.Orders.Cache.Update(order);
}
yield return order;
}
PXView.StartRow = 0;
Base.Orders.Cache.IsDirty = false;
}
Any guidance would be appreciated.