NAVdevTips 5: CurrPage – yes we can (again)
Those of you which had never built extensions probably even did not notice this inconvenient but anyone who needed to do so with previous version and wanted to use any of CurrPage function in code was annoyed that it did not work and we were losing time to find other way t0 do simple things. Why? Because events did not support the CurrPage – for example let’s check events for Page 22 Customer List. There is only Rec or xRec parameter in the events.
So if you wanted to use something like SetSelectionFilter functionality you simply could not do it because when sending record to the function it was only current record.
In AL,when developing pageextension, we got back our CurrPage functionality – and this gives us much more flexibility.
So let’s try to count the rows before running standard action Dimension Multiple. We can do it with simple code by adding trigger OnBeforeAction().
Now when selecting rows we exactly know how much of them we have.
Of course this is only example how to use CurrPage in extensions but you can use it also in all other triggers and your own actions as well. This will save a lot of time (at least for me).