+ Start a Discussion

custom clone button with selected fields

hi team,

Kindly help me how to clone the record with the selected field values. This should redirect to the edit page of the new cloned record


This can be accomplished in 2 steps.

1. Create a custom button to execute the trigger. Follow the guidelines explained in this post http://sfdc.arrowpointe.com/2009/01/08/invoke-apex-from-a-custom-button-using-a-visualforce-page/ 

2. The cloning logic as per the post at the link http://sfdc.arrowpointe.com/2011/03/28/cloning-records-in-apex/ which explains how to go about cloning the records. All you need to do is to query for the fields that you want to clone leaving others. 
hi ramu,

I want to create a CUSTOM clone button which will clone the record in edit mode and have to null few field values and then user can change some values and save the record.

Hi Ramu,

Can you provide the updated link to follow the guidelines. As the link which you have provided doesn't work as on date. Request you to do provide the updated link. Thank you in Advance.