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
Ben Jones, CollabraxBen Jones, Collabrax 

Controlling Sort Order on Visualforce Page

I have the follow visualforce page that uses a manage APEX Class.  The problem I have is that the output sort order seems to be completely random.  This page is run by clicking a button on an Account and Contact list view after selecting the records you want generated.  Since I don't have access to the APEX, is there a way to control the sort order elsewhere?

 

<apex:page standardController="Account" recordSetVar="SelectedContact" renderAs="pdf">
<apex:variable var="number" value="{!0}"/>
<apex:repeat value="{!selected}" var="SelectedAccount">
<apex:variable var="number" value="{!number + 1}"/>
<Scout9:StandardSheetLabel LabelNumber="{!number}" ProductName="5164" Brand="Avery" ShowBorder="false">
<table width="100%" height="100%" cellpadding="2" border="0">
<tr><td align="left">&nbsp;</td></tr>
<tr><td align="left">&nbsp;</td></tr>
<tr><td align="left">&nbsp;</td></tr>
<tr><td align="left">&nbsp;</td></tr>
<tr><td align="left">&nbsp;</td></tr>
<tr><td align="left">&nbsp;</td></tr>
<tr><td align="center" style="font-family:Arial, Helvetica, sans-serif; font-size:16px; font-weight:bold;">{!SelectedAccount.Salutation} {!SelectedAccount.FirstName} {!SelectedAccount.LastName}
{!IF(ISBLANK(SelectedAccount.Other_Name__c),'','& ')}
{!IF(ISBLANK(SelectedAccount.Other_Name__c),'',SelectedAccount.Other_Name__c)}</td></tr>
<tr><td align="center" style="font-family:Arial, Helvetica, sans-serif; font-size:16px; font-weight:bold;">{!SelectedAccount.BillingStreet}</td></tr>
<tr><td align="center" style="font-family:Arial, Helvetica, sans-serif; font-size:16px; font-weight:bold;">{!SelectedAccount.BillingCity},
{!SelectedAccount.BillingState}&nbsp;&nbsp;&nbsp;{!SelectedAccount.BillingPostalCode}</td></tr>
</table>
</Scout9:StandardSheetLabel>
</apex:repeat>
</apex:page>

 

sfdcfoxsfdcfox

The sort order would be controlled at the Apex Code level... so in short, without access to the code, you'll have no way of knowing how to set/change the sort order. You might try contacting the developer of the package to see if they have a parameter you can use, or if you're truly out of luck.

Nilesh ManeNilesh Mane

Is it resolved? I have solution. I have just done the same thing.

Ben Jones, CollabraxBen Jones, Collabrax

No resolution yet.  If you can provide help, it would be greatly appreciated!