I have a custom List button that links to a Visualforce page. I want the records selected in the Visualforce page to populate in a certain order. Any suggestions for accomplishing this? I've included my code below:
<apex:page
standardController="Order_Date__c"
recordSetVar="unused"
sidebar="false"
>
<apex:includeScript value="{!$Resource.UtilJS}" />
<apex:form>
<apex:pageBlock>
<apex:pageMessages />
<apex:pageBlock>
Note: All modifications made on the page will be lost if Return button
is clicked without clicking the Save button first.
</apex:pageBlock>
<apex:pageBlockButtons>
<apex:commandButton value="Save" action="{!save}" />
<apex:commandButton value="Cancel" action="{!cancel}" />
</apex:pageBlockButtons>
<apex:pageBlockTable value="{!selected}" var="a" id="table">
<apex:column headerValue="Name">
<apex:outputField value="{!a.name}" />
</apex:column>
<apex:column headerValue="Order Start Date">
<apex:inputField value="{!a.Order_Start_Date__c}" />
</apex:column>
<apex:column headerValue="Order End Date">
<apex:inputField value="{!a.Order_End_Date__c}" />
</apex:column>
<apex:column headerValue="Term Length">
<apex:inputField value="{!a.Term_Length__c}" />
</apex:column>
<apex:column headerValue="Allotment">
<apex:inputField value="{!a.Allotment__c}" />
</apex:column>
<apex:column headerValue="Sales Price">
<apex:inputField value="{!a.Sales_Price__c}" />
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>