You need to sign in to do that
Don't have an account?
Matt Hewson
When adding products to an Opportunity the list is not sorted alphabetically
When adding products to an Opportunity the list is not sorted alphabetically. How can I update this list view to display all my product alphabetically rather than randomly as the appear below?
This is my Apex code where it brings in the product list.
<apex:outputLabel value="Product Name" for="productName"/> <apex:selectList id="productName" value="{!PricebookEntrys}" size="1" required="true"> <apex:selectOptions value="{!items}"/> </apex:selectList>
Can anyone help sort the products alphabetically?
Thanks in advance for any assistance
This is my Apex code where it brings in the product list.
<apex:outputLabel value="Product Name" for="productName"/> <apex:selectList id="productName" value="{!PricebookEntrys}" size="1" required="true"> <apex:selectOptions value="{!items}"/> </apex:selectList>
Can anyone help sort the products alphabetically?
Thanks in advance for any assistance
You have to sort it in your apex class where you are fetching it.
Use Order By Name ASC in your SOQL query in Apex Class.
Thanks
Shashikant
All Answers
You have to sort it in your apex class where you are fetching it.
Use Order By Name ASC in your SOQL query in Apex Class.
Thanks
Shashikant
There was a sort() function messing everything up so I ordered by name and removed the sort() function and everything is working as expected.