function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
EBeachEBeach 

Button to Clone Records with Record Type

We're cloning a custom quote object record with a button that references an Apex Class.  Currently the clone button results in creating a cloned record with the default record type.  I would like to specify that the record type of the original record is also the record type of the cloned record.

 

Is this possible?

Best Answer chosen by Admin (Salesforce Developers) 
forcedotcomforcedotcom

You just need to update your Apex Class to copy the RecordTypeId of the original to the 'Clone'

All Answers

forcedotcomforcedotcom

You just need to update your Apex Class to copy the RecordTypeId of the original to the 'Clone'

This was selected as the best answer
SK81SK81

I have a similar issue . While I am using Sys admin profile to clone a record then the record is cloned with that particular Record Type (e.g. Record Type is 'A' of parent record and record Type of cloned record type is also 'A' irrespective of the default Record Type of Sys Admin profile.)

But when I log in with a custom profile, and do the same cloning , then the Record Type of cloned case becomes the default Record type for the custom profile .i.e. if default Record type for the custom profile is 'B' , and we do the same action as we did above , then the Record type of the cloned case will be 'B' and not 'A' (which happened earlier.)

 

Kindly advice ....

Thanks in advance .

SK81SK81

Forgot to mention that I am working on Cases