I’m working on a customization for a Process Screen in Acumatica and ran into an issue related to correct pagination when using a View Delegate.
Here is the goal:
I need to build a View where for each Equipment I calculate the maximum Appointment date. This part works fine using a Projection.
Next, I need to calculate the difference between the Business Date and the Max(AppointmentDate) for each Equipment.
Then I need to filter records where this difference is greater than 10 days.
Since filtering by a computed value cannot be done within the Projection, I implemented the filtering inside a View Delegate.
The problem is that when I filter the records in the Delegate, Acumatica receives fewer records than expected. As a result, the StartRow and pagination logic break, because the system still thinks the dataset contains more rows than what I actually return.
What is the correct way to implement filtering based on a calculated value (difference of dates), but without breaking pagination on a Process Screen?
Is there a recommended approach to properly handle startRow, maximumRows, or to return the correct total record count inside a View Delegate?
Any advice or working examples would be greatly appreciated.