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
jwegnerjwegner 

Mass render multiple records in one VisualForce page

I have looked in the Cookbook, Apex and VisualForce guides, and I've also searched these forums for a solution, but haven't found anything as of yet.

 

Could someone please point me in the best direction for accomplishing the following:

 

 

I have created a VisualForce page that references a custom object (called Invoice) which is in a master detail relationship with a child object (Inventory).  I've added a custom link to the Invoice page layout which correctly renders information stored from the Invoice record and any children Inventory objects.  We print the Invoice for our customer from this page, or email them an invoice from a modified VisualForce template.

 

Is it possible to modify the VisualForce page or the custom link I'm calling to render the page to display multiple instances of this page in one file or one browser window?  For example, if I'm trying to print 50 invoices related to another custom object, Store, with a lookup relationship, is there an easier way to print all fifty of these invoices than clicking the VisualForce link on each individual record?  If this is easier to do in a PDF than rendering in the browser, that would be acceptable as well.

 

Thanks for your time and attention, and let me know if I need to be more descriptive.

Best Answer chosen by Admin (Salesforce Developers) 
gwpgwp

Hi, I had the same problem as I could not get the detail tag to work as I wanted.

I posted some code attempts and got some community help to solve it. Here's the solution:

http://boards.developerforce.com/t5/Visualforce-Development/Rendering-mutiple-records-with-related-lists/m-p/272751/highlight/false#M34985

All Answers

wesnoltewesnolte

Hey

 

It is indeed possible. You could in fact repeat using <apex:repeat> similar code to that which renders one page. You would pass the <apex:repeat> tag a list of these invoices and it would render as many invoices as you have objects in the list. Of course you would also have to change the logic in your controller.

 

The solution you're suggesting might be a bit clunky as you might end up with one reeeaallly long visualforce page if you have a large number of invoices. But the above suggestion should do what you want.

 

Cheers,

Wes 

gwpgwp

Hi, I had the same problem as I could not get the detail tag to work as I wanted.

I posted some code attempts and got some community help to solve it. Here's the solution:

http://boards.developerforce.com/t5/Visualforce-Development/Rendering-mutiple-records-with-related-lists/m-p/272751/highlight/false#M34985

This was selected as the best answer