+ Start a Discussion
go_bear_2001go_bear_2001 

How to override Clone button

Hi,

 

I'm trying to override a Clone button on one of our custom objects(Lead_Line_Items).  Basically I have 2 record types for this object (i.e Record Type A and Record Type B).  What I want is to override the Clone button sothat when I clone  the Lead_Line_Items object and regardless of the current record type of the object I'm cloning, the new object will be always set to have Record Type A.

 

As far as I know, I have to write a Visualforce page to override a standard button.  I'm searching around for a sample Visualforce page that overwrite a standard button but could not find any yet.  Can anyone mind to share a short sample VF page that help me to get started?  any other ideas/suggestions for solving that problem are welome.  

 

Thanks,

Klein

Message Edited by go_bear_2001 on 09-28-2009 07:12 AM
Anand@SAASAnand@SAAS

You can override standard buttons. Go into the object setup on your org and you see this option if you scroll down on your custom object definition.

 

You do need to have a Visual Force page that should be called when the user selects "Clone". 

GuyClairboisGuyClairbois

Hi Klein,

 

This thread may help: http://community.salesforce.com/sforce/board/message?board.id=ajax_toolkit&message.id=7912

 

Guy

 

go_bear_2001go_bear_2001
Thanks Guy.  I made it work by appending clone=1 and recordtype into the URL.