Example 1:
 

Example 2:
Apex Class:
public class con {
    public contact c { get; set; }
    public con() {
        c = new contact();
    }
    public void search() {
        // c.accountid has the selected ID.
    }
}
VisualForce Page:

  
    
      
         
      

   

  

Written by 

Salesforce MVP | Lightning Champion | 17x Salesforce Certified | Application Architect | 7x Trailhead Ranger | Techforce Services | Australia

Leave a Reply

Your email address will not be published. Required fields are marked *

*