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

Opp item lines not printing in correct order

We have an opp with item lines as follows


Product X

Product Y

Product Z


We print it using the PDF rendered in VF and it outputs in a seemingly "random" order


Product Y

Product Z

Product X


Is this a known issue -- is there any way of working around this problem? ***Ideally*** what we wouild love to be able to do is grouped items e.g ...



2 x $500.00   Programming    $1000.00 

3 x $500.00   Testing             $1500.00  



12 x $10.00   12 Months Hosting       $120.00   

12 x $1.00     12 Months Domain Reg $12.00    


It all comes down to the SOQL queries.


If you don't do grouping, then use "order by" to put your Opp-Products in an order.  Or see or for other ways to do it.


Grouping is more tough - you may need to do a separate query for each group, which could run into governor limits.  

Hope this helps.