You need to sign in to do that
Don't have an account?
Anil Savaliya
Create Clone button on Custom visualforce for Custom Object which assiged to Tab
Hi,
I have custom object Target.we are created custom visualforce page and assigned to Target Tab.We used custom visualfoce for targert because we have lot of validation during record save and page layout implemention according to product selected.
Example : Assiged Visaulforce CreateTarget to target tab (/apex/CreateTarget).Now business want to create clone button on created visualforcepage (CreateTarget).Is there any API for Clone or Idea?
Please help on create custom clone button on visualforce page?
I have custom object Target.we are created custom visualforce page and assigned to Target Tab.We used custom visualfoce for targert because we have lot of validation during record save and page layout implemention according to product selected.
Example : Assiged Visaulforce CreateTarget to target tab (/apex/CreateTarget).Now business want to create clone button on created visualforcepage (CreateTarget).Is there any API for Clone or Idea?
Please help on create custom clone button on visualforce page?
Please mark as answer if this helped and work.
Bryn
You can use URL hacking for this like, Crate a Command Button named Clone on VF page as follows:
<apex:pageBlockButtons id="editBtn">
<apex:commandButton id="cloneBtn" value="Clone" action="{!cloneCase}" />
</apex:pageBlockButtons>
On controller write the following code snippet:
public class CloneCaseController{
Id recId {get; set;}
public Pagereference cloneCase() {
recId = ApexPages.currentPage().getParameters().get('id');
if(recId == null) return null;
Pagereference targetClonePg = Page.<Your Page Name>;
targetClonePg.getParameters().put('clone', '1');
targetClonePg.getParameters().put('id', recId);
targetClonePg.getParameters().put('retURL', recId);
return targetClonePg;
}
}
Amit @ it's work for standard page.
I am working on cloning function too. Your code works for cloning. However, how to save the current record at the same time? The code copies everything I type in, but not saving the current record.
Thanks,