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
Geo NoGeo No 

Help in the integration of a visualforce page

Hi,

I'm not a developer and I need some help in the integration of a visualforce page. I found this interesting article in the salesforce cookbook:
http://developer.force.com/cookbook/recipe/dynamically-updating-a-page

It is basically the integration of a field "Reason lost" in a visualforce page. I completed the tutorial described in the link above but when I try in a real opportunity to setup the stage as "Lost", I am not redirected to the visualforce page.

Is there anything to do to activate the visualforce page when the sales stage "Lost" is selected?

Many thanks for your help!
ShashankShashank (Salesforce Developers) 
According to the article, you can only access the vf page through the url that is mentioned in it. To be redirected to the vf page when you set the stage to "Lost", what you can do is to create a custom button with this URL and use that button to close as lost. The URL in the custom button would be "/apex/opportunityEdit?id={!Opportunity.Id}"
Geo NoGeo No
Hi Shashank,

Thanks for your help. I would like to avoid my end-users to click on a button to update the reson lost field. Is there anyway to trigger the VF page when the opportunity stage is set up on Lost? or is the button the only way?

Thank you!
ShashankShashank (Salesforce Developers) 
Unfortunately, we cannot automate the triggering of a VF page. Instead, you may have to go for a full visualforce page solution and replace the standard opportunity page with the visualforce page.
Geo NoGeo No
Alright Shashank, thank you for these information and your help!