function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SivaGSivaG 

Picklist arrangement in Visualforce page

Hi,

I have a requirement wherein I have to rearrange four picklist values displayed in a vf page as given below .

Current display order  - 

Please Select one
3 Day Shipping
Ground shipping
Overnight shipping

Required display order -

Please Select one
Ground shipping
3 Day Shipping
Overnight shipping

Thanks
Kumar
Best Answer chosen by SivaG
Tejpal KumawatTejpal Kumawat
Hello Kumar G,

You can rearrange eaisly..

Go to Picklist Field --> Click on "Reorder" Button --> Rearrange picklist values.

If this answers your question mark Best Answer it as solution and then hit Like!
 

All Answers

Tejpal KumawatTejpal Kumawat
Hello Kumar G,

You can rearrange eaisly..

Go to Picklist Field --> Click on "Reorder" Button --> Rearrange picklist values.

If this answers your question mark Best Answer it as solution and then hit Like!
 
This was selected as the best answer
SivaGSivaG
Hi Tejpal,

My picklist field value is dynamic and we are getting these values from a Custom object and displaying it in vf page. Code is given below.
Of late Property_Value__c value for Groundshipping is changed from FREE to 5.99 and that changed the picklist display order in vf page.
Property_Value__c is a Text field in Channel_Property__c object.

List<Channel_Property__c> channelPrty = [SELECT Label_Name__c,API_Name__c,Property_Type__c,Property_Value__c,Channel__c,Min_Max_Indicator__c,Description__c,Comments__c,Sort_Order__c,Shipping_Options__c FROM Channel_Property__c WHERE Channel__c=:channel.Id AND (API_Name__c=:'OvernightShippingFee' OR API_Name__c=:'StandardShippingFee' OR API_Name__c=:'GroundShippingFee') Order by Property_Value__c DESC];
            System.debug('channelPrty'+ channelPrty);
            ShippingOptions.add(new SelectOption('', 'Please Select One'));
            if(!channelPrty.isEmpty()){
                for(Channel_Property__c chprty : channelPrty){
                    if(chprty.API_Name__c == 'GroundShippingFee')
                        ShippingOptions.add(new SelectOption('Ground Service',chprty.Label_Name__c +'($'+chprty.Property_Value__c+')'));
                    if(chprty.API_Name__c == 'StandardShippingFee')
                        ShippingOptions.add(new SelectOption('3 Day', '3 Day Shipping Fee' +'($'+chprty.Property_Value__c+')'));
                    if(chprty.API_Name__c == 'OvernightShippingFee')
                        ShippingOptions.add(new SelectOption('Overnight',chprty.Label_Name__c +'($'+chprty.Property_Value__c+')'));

Thanks
Kumar