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
Brian FerrariBrian Ferrari 

Create a Visual Force page for a new Clone case button.

Hello

My users often use the clone case button.  Unfortunately, the cloned cases have fields populated that should not be when a case is first created.

Currently, I clear some of the fields using the URL on a custom button but I would prefer to create a VF page that mimics my case page layout. What is the easiest way to basically duplicate my Standard case page layout in VF for my new Clone case button?

Thank you in advance for your time.

B
Best Answer chosen by Brian Ferrari
Terence_ChiuTerence_Chiu
Hi Brian, if the majority of the fields need to be cloned over and you need the user to manually input only a few fields before the clone occurs I could suggest building the VF page and only prompt the user for those select fields. The VF page would have an Apex controller that would perform the clone the record. Before the record is saved, the user would input the fields that needed to be changed and when they click save, a custom Save action method would be called from the controller class save insert the record with the additional manual changes the user has made.

All Answers

Terence_ChiuTerence_Chiu
Hi Brian, if the majority of the fields need to be cloned over and you need the user to manually input only a few fields before the clone occurs I could suggest building the VF page and only prompt the user for those select fields. The VF page would have an Apex controller that would perform the clone the record. Before the record is saved, the user would input the fields that needed to be changed and when they click save, a custom Save action method would be called from the controller class save insert the record with the additional manual changes the user has made.
This was selected as the best answer
David Helgerson 1David Helgerson 1
Hey Brian, you could use the Super Clone appExchange app ( https://appexchange.salesforce.com/listingDetail?listingId=a0N3000000B4mjFEAR ). It will let you configure if a field should be cleared, set, or cloned. Related list records can be cloned also. If your users prefer the standard edit screen, Super Clone can be set to clone the record, bypass the confirmation, and bring up the native edit page.  The app is free.