+ Start a Discussion
SharadSharad 

VF page executes on the click of button which I not specified with

Hi,

 

I have created a custom button on Opportunity detail page called 'Reject' and associated a VisualForce page on click of this button. Created an extension to custom controller Opportunity.

 

Inside this VF page, I am displaying Opportunity detail page with few more information. This means I am showing the default standard buttons which are there in Opportunity detail page.

 

<apex:page standardController="Opportunity" tabStyle="Opportunity" action="{!saveFormalBids}" extensions="INTLC_VFExtension_Oppor_Rejection" >
<apex:detail subject="{!opportunity}" relatedlist="false" />
....

 

 

After I click on 'Reject' button, VF page called fine and also does whatevr I specified in the controller extension. After the page is displayed, When user click on  standard 'Edit' button on Opportunity detail page, make some changes on oppor detail page and then click on standard 'Save' button, the same VF page and the extension controller get called which I attached on click of 'Reject'.

 

I believe, this should not happen on click of standard 'save' button as I haven't override this button at all.

 

 

Please advise if this is some bug or I am missing something here.

 

 

Thanks in advance !

 

Sharad

mmacmmmacm

Hi,

I am seeing similar behaviour and would like to know what the options are to code around.

 

Is there a way to override the return behaviour from a standard object edit (in my case Lead) and persist the values from the Visualforce page? In other words to return to the previous state after the Save on the Lead?

 

Another approach would be for the edit page to display the detail after Save and a custom button to return to

the VF page. However its the same problem - once click Save on the Lead detail the retUrl reverts to initial VF page.

 

Any guidance on how to control the return from a standard object edit from a visualforce page would be great.

 

Thanks very much,
Martin