• sanu rajak
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
Hello,

I have a map with Name(String) and Ranks(Integer),
Name is the Pricebook name and Rank is Order by.
map<String,Integer> mapOfNameAndRank = new map<String,Integer>();

Name1, 1
Name2, 2
Name3, 3
I am populating SelectOption in below manner: 
public list<SelectOption> listOfOpt {get;set;}
for(priceBook2 prc : [select id,Name from priceBook2 ){
            listOfOpt.add(new SelectOption(prc.Id,prc.Name));
        }

My usecase is that, the SelectOption should display the Name is the order defined in map.

How can i reiterate the SelectOption inorder to order it.

thank you for suggestion
  • May 05, 2020
  • Like
  • 1