You need to sign in to do that
Don't have an account?

How to clone the record without related list in salesforce
Hi,
I have custom object with standard clone button that is cloning with its case related list. How to exclude the case related list when cloning the record.
Can you please suggest?
Thanks,
Prasad.
I have custom object with standard clone button that is cloning with its case related list. How to exclude the case related list when cloning the record.
Can you please suggest?
Thanks,
Prasad.
You can create a custom button call your apex class (which will clone of Sobject) and show this to on detail page.
Do you have any code for excluding related list when cloning the record?
Thanks,
Prasad.
Example of Lead object record
public class cloneSobject
{
public static string cloneSobject(String id)
{
string returnMsg = '';
List<Lead> lstlead = [select id,Name from Lead where id in: id];
lead objLead = new lead();
if(lstlead.size()>0)
objLead =lstlead[0].clone();
if(objLead != null)
insert objLead;
return returnMsg;
}
}