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
Cameron WalkerCameron Walker 

Open Visualforce Form Before Closing an Opportunity

I want to be able to direct the user to a visualforce form before closing an Opportunity. Upon completing this form, I want the opp to complete its closing.
 
I'm relatively new to salesforce and salesforce development, but one alternative I considered is a validation rule that requires them to submit my form (and add a related custom object) before they are able to close the opp. This left me to add the form as part of a page layout or as a custom quick action. However, this is not ideal because I want the flow to be seamless for closing the opp. I want the form to be part of closing.

Is there a way to accomplish this?
Abdul KhatriAbdul Khatri
Few design approaches I can think of are
  1. Do not allow user manually select Close Opportunity Status for closing the opp. Have a validation rule preventing them and in the rule, ask them to submit a form and at the end of the form submission through trigger close the opportunity automatically by update the Opportunity Status to Close.
  2. Another approach is to create a custom Save Button (bad bad approach) as you need to consider update case also.