2

If I use custom VF page to override the Save functionality @ Opportunity level, what will be the impact on the Triggers, VAlidation Rules and any other codelinked with the entity?

In a nutshell, I am trying to gather what are the consideration while moving a standard page to the the custom VF page.

I want to override SAve button since I want to go for a webservice call at the time of creation of an opportunity.

I also have an option to override New button of Opportunity but since the check is on the related Account of the Opportunity , I have to be careful when someone tries to create an opportunity directly from the Opportunity tab but not through related list of the Account.

Any suggesstions on how to proceed in such a scenario will be useful.

2 Answers 2

2

To answer your initial question:

"If I use custom VF page to override the Save functionality @ Opportunity level, what will be the impact on the Triggers, VAlidation Rules and any other codelinked with the entity?"

triggers, validation and workflows happen at the platform level, and no matter how an object is saved to the database, they will fire.

1

One way is to use what is called a Controller Extension. So you could convert your standard page layout into a VF page and use the Standard Controller for the Opportunity to keep the other functions as they are. You can see an example here

public class myControllerExtension {

private final Opportunity Opp;

public myControllerExtension(ApexPages.StandardController stdController) {
    this.Opp = (Opportunity)stdController.getRecord();
}

public PageReference save() {
    // call web service
    // insert Opportunity
}
}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .