In here I want to add 3 buttons which will do following
01. Mark the records
02. Filter the marked records
03. Clear the filters
In order to add the buttons, I will open the Customer Ledger Entry page in the development environment and go to Action Designer
In the action Designer, let’s add 3 buttons Mark, Marked Only and Clear Marks. Then I make them promoted and big and also added to Category4.
Then let’s write small code to do the work.
Add above code to each OnAction trigger. Once you complete the code it will look like below
Let’s run the page and it will look like below with nice ribbon with the all new custom filter buttons.
Now user can select random records by clicking on the “Mark” button.
When the user click on the Mark button system will select the record and also it will show a tick mark in the page. Once the records are been marked, next step is to filter the marked records to have a one nice view. In order to do that user just have to click on the “Marked Only” button.
See.. System will filter the marked records and create a one simple view. Once the work is been done and user want to un-mark the view, user need to click on the “Clear Marks” button and it will un-mark the records.
But this is a empty record view and what has happen to the rest of the records?? To get all the records just click on the “Marked Only” button again.
User will get the original view with all the entries.
Simple?? Yes it is!! It is a really easy way to provide a custom filter to users. + We didn’t work with any record variables or created any variables, you can just copy paste the action button to the other pages and use this functionality.
Or if you need you can make this function a global one with the use of a codeunit and RecordRef. Up to you to decide.
Hope this was helpful and if you need the page object you can get it from this link. Or you can use below code and directly add to the page (text).
Please provide your feedback with a comment.
Thank you and Regards,
Tharanga Chandrasekara
2 comments
very nice,
onlything that does not work is when you open the card of the record.
it will open but the markedonly filter will not be enabled, when using the next and previous button you will find out that it has the whole set and not the marked set (which was active in the list view)
very nice,
onlything that does not work is when you open the card of the record.
it will open but the markedonly filter will not be enabled, when using the next and previous button you will find out that it has the whole set and not the marked set (which was active in the list view)