+ Start a Discussion
Rahul Gupta 137Rahul Gupta 137 

VF page via button

I want to create a custom button on the detail page of account that shows no of contacts and opportunity for that account.Custom button should invoke a VF page that has above details 
Hi Rahul,
This is possible, please follow below steps:
  1. Create a visual-force and controller. 
  2. Controller will accept one parameter as Account Id. 
  3. Query on Contact and Opportunity with the Account Id and put the records in wrapper / List / Map. 
  4. Use Apex page block table / Data table to display the data on vf page. 
After VF page.
  1. Create custom button with follow details
    1. On Detail page
    2. Load in new window with no header / side bar
    3. In the formula bar type: /apex/vfpageName?accId=account.id

use the above parameter (accId) in controller side.

Hope this helps. If you still have doubt please ask. 


Skype: gaurav62990

Rahul Gupta 137Rahul Gupta 137
I am really sorry gaurav it would be helpful if you would be able to give detail code  of it 


I am here to guide how to resolve an issue, but could not provide the detailed code for this, if you any insight of how can we implement this other than above information, you can contact me directly on skype: gaurav62990