HI , I want to have alphabetical sorting on my page to extract the records by the start of its letter like we have in standard salesforce page like a, b c, d…plz suggest
You can make a condition in the model like Name starts with ‘’ Filterable.
And make buttons or a filter in a table to set and apply the condition with each letter
Can you please explain the second part of your answer. I mean would be helpful if you provide an example.
Thanks in advance
You can do a lot of things, this are examples (quick thought):
Create buttons for each letter with a redirect to your page adding the “nameofthefilter=a”, “nameofthefilter=b” …
for example: (assuming the page is called ‘ListPage’ filter is called ‘namestartswith’) the url will be something like ‘/apex/ui?page=ListPage&namestartswith=a’
this will refresh the page and set and activate the condition ‘namestartswith’ with the letter a.
3.- filter in the table.
Create a filter in a table with all the options and set and activate the condition.
Pros: refresh only the table, not the page. Cons: it’s a table filter it will be shown as a select box in the table (not like an index)
4.- filter in a table with an aggregate model.
- Create a formula field in your object to get the initial.
- Use this field in a aggregate model of your object to get all the initials (group by this field)
- create a filter in the table to set and activate the condiiton.
- configure the filter to get all the options from the rows of the aggregate model.
Pros: same as point 3 and you don’t have to write all the letters, and if there is no record with the initial M, the M letter will not be shown.
Cons: same as point 3 and if there is no record with the initial M, the M letter will not be shown. (maybe you don’t desire this behaviour)
Thanks Pablo for your reply…will try it out and will let you know.
Yes! Thanks Pablo. You’ve gone far above and beyond what I was thinking. I was going to stop at idea #3…