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
CharlesDouCharlesDou 

customizing New Opportunity Controller.

Hi everyone:

 

I am trying to create a new opportunity with some information automaticly flowed from an Account. Which apex class should I modify? Or is there any other methods. Thanks a lot.

Madhan Raja MMadhan Raja M

Hi Charles,

 

What kind of information you need to populate from Account when Opportunity record is created? You can use Formula fields or Trigger (it depends on your requirement) to populate Account data into Opportunity record.

 

Madhan Raja M

CharlesDouCharlesDou

The information I need are some contact information such as email address and shipping address. I can do that with a trigger, but I would like the information to show on the page after I clicking the "new opportunity" button. Is there any way to do that?

Madhan Raja MMadhan Raja M

I assume that, when New Opportunity button is clicked from Account related list, email address and shipping address should be populated in the Opportunity record? If yes, then this can be done with the help of Visualforce page and Custom controller.

 

Madhan Raja M

CharlesDouCharlesDou

how to do that with a VF and  Custom controller? Do I need to create a new VF?

Madhan Raja MMadhan Raja M

Yes, we need to clone the Standard page layout to Visualforce page and write a extension class(Logic) for that Visualforce page.

 

Madhan Raja M