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
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');