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
TeashaTeasha 

New Custom Convert Button on Custom Object

Hi,

 

I have a custom object that I'd like to add a convert button to.  I'd like to convert the object to an opportunity at a specific stage.  I'd also like to add in validation rules for the conversion.  Any ideas?

MarkSilberMarkSilber

You have a couple options - the first depends on how many fields are on this object that need to be copied over to the Opportunity. If it's only a few, you might be able to create a custom button on the object that passes parameters to the Opportunity (via URL passing to the new Opportunity screen) to pre-populate key fields like Name, Stage, Account, etc. The validation could occur on the Opportunity record itself when a user attempts to save it.

 

Although this would work for creating the Opportunity, you would need to deal with how to mark the existing record as "converted" after the Opportunity is created, which would be difficult if not impossible using standard workflow.

 

The second option would be a Visualforce page that guides the user through the conversion process. Using this method you would have complete control of how the new Opportunity is created and capability to update the custom object that was converted after the Opportunity is created.

 

Of the 2 options, the first is the easiest but might only give you 90% of what you need.