I think on every list page has their own default data filter.
Then how would I know what is user currently filter on page if I want to sum data according to that filter ?
It's not CurrPage.SetSelectionFilter right ? :(
I think on every list page has their own default data filter.
Then how would I know what is user currently filter on page if I want to sum data according to that filter ?
It's not CurrPage.SetSelectionFilter right ? :(
Every page object has an implicit record variable called Rec. The recordset that a user sees on a page comes from that record variable, respecting any filters, sort orders etc. the variable may have. Because it has such an immediate effect on the screen rendering, I think it's a best practice to leave Rec alone as much as possible, letting any added functionality work on another record variable. So how do we transfer filters etc. from Rec to a new record variable (with the same Subtype as Rec)?
Rec.GETFILTERS may seem a good candidate, since it returns the current filters set on Rec. However, please bear in mind that GETFILTERS respects the current filter group: without further actions, it will only return filters set at filter group level 0.
A more efficient approach would be to use COPYFILTERS instead. It allows you to copy all filtering (all filter group levels; including records marks, if I'm mistaken) from one record (i.c. Rec) to another (your custom record variable). After that, you can sum the relevant values in your own record variable.