You need to sign in to do that
Don't have an account?
John Neilan 2
Clone Custom Object Record & Redirect to VF Page
Hello,
I have a button on the Opportunity object that clones a record from a related custom object. The clone works fine, but it opens the standard edit page for the custom object. Instead, I would like the clone to open a custom VF edit page. Is this possible to do? My current URL for the button is:
I have a button on the Opportunity object that clones a record from a related custom object. The clone works fine, but it opens the standard edit page for the custom object. Instead, I would like the clone to open a custom VF edit page. Is this possible to do? My current URL for the button is:
onClick="window.open('/{!Opportunity.Sumary__r.Id}/e?clone=1','_blank')"
1. Create a Custom Controller for your Visualforce edit page. 2. Create a Visualforce edit page named SummaryClone. Now that you have the original Summary__c record stored in your controller you can edit the field values using apex:inputFields.
3. Create a new custom button on the Opportunity object. The button should be a Detail Page button type and open a URL.
The URL would be apex/SummaryClone?summary_id={!Opportunity.Summary__r.Id}
Hope that helps,
Clint
All Answers
1. Create a Custom Controller for your Visualforce edit page. 2. Create a Visualforce edit page named SummaryClone. Now that you have the original Summary__c record stored in your controller you can edit the field values using apex:inputFields.
3. Create a new custom button on the Opportunity object. The button should be a Detail Page button type and open a URL.
The URL would be apex/SummaryClone?summary_id={!Opportunity.Summary__r.Id}
Hope that helps,
Clint
Thanks! That actually helps me with another issue I was trying to solve! For this issue, all I had to do was replace the Clone button on my custom object with my VF "edit" page on that same object and it now clones my record but opens it in the custom Vzf page rather than the standard edit page. Thanks for your help!