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
Michael DeluccaMichael Delucca 

fetch multiple records single object

Hi Everyone!
I have been doing a lot of research and haven't found an answer that suits my needs yet and thus would greatly appreciate any input. I am interested in creating an email template (most likely visual force and custom controller) that can fetch multiple reservation records for a single account object. 
Specifically- For each account (custom object called Viper in this scenario), I want to be able to access each reservation listed under their account and display them individually. 

Our current Salesforce setup includes:
Two (2) custom objects w/ a master-detail relationship
Object One – “Vipers” holds the customer contact information (master)
Object Two – “Reservations” holds the customers reservation information (child)
Any “Viper” record can have multiple “reservation” records attached.


Rough example of what I want below: 

  1. For Account(Viper)
    1. Reservation #1 object details
      1. all desired fields from this reservation 
    2. Reservation #2 object details 
      1. all desired fields from this reservation

Thank you for your time everyone! I really appreciate it! 

Ch. Szandor KnappCh. Szandor Knapp

Hey Michael,

I cannot see a real question here. What your\e intending is doable from what I could gather from your explanation. And your design makes sense. Do you have any specific questions?

Kind regards,

Sz