+ Start a Discussion
AncaDAncaD 

Populate fields on a custom Opportunity page with values from the Contact object

Hi,

 

I have a Visual Force page for the Opportunity object and need to auto populate the contact field on that page with the name of the contact that the opportunity is created for (when the opportunity is created from the Contact page). I know that this is possible when using the standard Opp page.

 

Is there a way to do this on a custom Opp page?

 

 

Thank you!

VisualForceVisualForce

Hi..

    U can pass contactid with ur page calling function.. In opp extension class u can fetch this id and display it in ur custom opp page..

 

Sample

button behaviour : onclick javascript

javascript code:

 window.location.href = '/apex/urVFpagename?lkid={!Contact.Id}';

 

In ur controller or extension class:

 

u can fetch this id

id contid=Apexpages.currentPage().getParameters().get('lkid');