Hi Guys
Stumpled on a need to select multiple records in a listpage, run a function, and then keep the selection afterwards.
But af running the function, that alters records, the selection is lost.
I have the selection in a record saved with SETSELECTIONFILTER, but can i pass that back to the page?
Follow me on my blog
juhl.blog0
Answers
You could, however, mark them, by looping through the var where the selection has been saved and marking the records in Rec variable. Not exactly the same, but may be sufficient?
Also, you could look into how you modify the records, maybe this bit can be changed to avoid losing the selection?
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
No thats not gonna be enough.
The function i have made is updating a sorting number, to move records up and down. When the users only moves one record, I use get afterwards, to highlight the record just moved, so the users can just presse the UP button 10 times to move it up 10 places. But this can also be done with multiple records, and it’s not user friendly to mark all records for every push of the up or down button.
But after changing the records I loose the highlighting of the records.
Maybe the user could enter the replacing sorting number instead, and make that visible. Instead of the up/down button for multiple records?
What do you think? Or any other ideas
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
I’m gonna look at the solution to enter the replacing sorting number instead.
Thanks Slawek
Try to add a column to your page and use the MARKED property as a source. When you have a selection made by the user the first thing in the code would be to mark all selected records and then update sorting order. Subsequent calls to move up/down would check if something is already marked and if yes just update the sorting column without re-marking records.
Exposing MARKED as a column would let the user see what she/she selected in the first place, the code moving rows would work, and the marking would not be lost after changing sorting column.
It is nice functionality from user experience/usability point of view, but I can see the troubles coming. What will happen if a user clicks any header and change the sorting order on the page? It's gonna be a little complicated to make such a functionality foolproof.
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
Code and a button to clear MARKED should be implemented.
Thanks.
ones.
I'm more concerned with moving the block up or down in the code. It's because the 'up' and 'down' has to be analyzed and updated in the context of current display order, which will be different to your hidden sorting column once a user clicks any column header.
To make it work all the time you would need to either disable sorting (for example by using an expression in every column SouceExpr) or to detect the current sorting order and re-seed your hidden sorting column before moving the block up and down.
Secondly, you probably need to make the page to work on a temporary record to avoid hidden sorting column update conflicts if more than one user opens the same page at the same time.
It looks like it would need quite an effort to make it work nicely and trouble-free.
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
Just got sidetracked with a more important case, but will look into this.