+ Start a Discussion
Jodi Nemser-AbrahamsJodi Nemser-Abrahams 

Adding a lookup field to a VF page whose value can be passed to a dynamic report with a button


I'm quite new to VF and Apex and am looking for some help!

I would like to add a lookup field to a VF page to find a contact.  I also want a "report" button that will pass the id of this contact as a parameter in a report.

I'm not really sure where to start with this!  Any help would be awesome (in beginners terms, preferably!).  Ideally, I would like to be able to add several lookups in the same VF page that are all for different objects, including contacts and one custom object.  But, that's stage two.

I found this thread that I think might be my answer, but I'm too much of a newbie to understand what to do with it!

Thanks, all!!  
SonamSonam (Salesforce Developers) 
To have your own custom lookup on a VF page - I would suggest you to check this blog:http://blog.jeffdouglas.com/2011/08/12/roll-your-own-salesforce-lookup-popup-window/

Well written and has sample code which you can test in your ORG to understand it better.

As for the report requirement - not sure what you meant by passing the ID of contact to the report?