I need a solution for the follwing scenario
Ability to Clone a Closed Won Opportunity (Clone Button)
- clone button should appear only when Opprty status = Closed/Won
- when chosing to clone - if field A = value1 or value2 - clone is opssbile, otherwise not
- when cloning some Opprty fields must remain blank, others to take the value from cloned opportunity
- new cloned oppty type = maintenance as default value (different from original)
- expiration date on new oppty = expiration date on original opp + 1year
- when pressing clone button, user to be taken in edit mode (don't auto-save clone)
Is this possbile only by creating a new custom button ?
Any help on how to start working on this is much appreciated.
Thank you,
Bianca
2 answers
Hello Bianca,
1) clone button should appear only when Opprty status = Closed/Won :
You need a separate Closed Won Record Type and a Closed Won pagelayout,add the "Clone" button to this pagelayout only.
You can set the record type to Closed won Record Type through a workflow rule or process when the Stage is set as "Closed Won"
2) About the Clone:
You have 2 options:
Visual Flow:
You need a custom "Clone" button to get what you are looking for. The standard clone button always clones all the fields of an Opportunity record.
You also need to create a "Flow", so you call this flow from the custom button. The flow should take care of selective cloning and expiration date values.
Here is a link which explains the details of it:
https://salesforceyoda.com/2015/04/08/i-wanna-flow-clone/
OR
APEX Coding, you can browse through some solutions in the developer forum.
You also have an option to use the URL method to clone only specific fields, but this is a limited solution. If you have more number of fields to pass in the URL you will end up hitting URL length limits.See here:
How to clone opportunity (or any record) excluding specific fields?
https://help.salesforce.com/articleView?id=000230954&type=1
Hope this helps you and you get an overall idea.Good luck!