How to clone a record using custom button in salesforce
USE CASE A user wants to create new records by mirroring the existing records with minimal clicks using the “Button” (Cloning the records). SOLUTION Create the custom button where all the user-requested fields will be mapped. Add created a custom button on the page layout. Create a Custom Button Go to Setup - Object - Buttons, Links, and Actions Section -- Click New button or Link -> Enter Label Name(Account Transfer) Select Display Type as “Detail Page Button” and Content Source as “ URL ” Add all the user-requested fields with their IDs and add the return URL with the Object id. If the field is Lookup, Prefix CF with field id (See the below Image) Finally Save all the works you did. 6. Add created “ Custom Button ” on the Page Layout. 7. When Clicking on the “ Account Transfer ” Button, Whatever the mapped fields in the button will...
Wrapper Class
Apex Controller
Visualforce Page