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
Victor EcheverríaVictor Echeverría 

Auto populate custom field in opportunities with primary contact information

I'm relatively new to visualforce and I'm trying to display the primary contact information in a visualforce page that is created by a button in the opportunities object. For that I have a custom field in the opportunities page layout which I want to auto populate with the primary contact for the opportunity.  What would the best method for obtaining the primary contact information from contact roles? Is there a way for the field to auto populate when the opportunity is created?