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
Rahul AlladaRahul Allada 

isClone() not working as expected

Account acc = new account(name='Rahul');
insert acc;
account acc1 = acc.clone();
insert acc1;
Account accc = [select id from account where id =: acc1.id];
system.debug(accc.isClone());//Supposed to display true
But it is being displayed as False. 

It is supposed to show true as acc1(accc) is a clone of acc

Best Answer chosen by Rahul Allada
VinayVinay (Salesforce Developers) 
Hi Rahul,

Returns true if an entity is cloned in your use case acc which is an actual record in database will show true and isClone() will written false.

Please mark as Best Answer if above information was helpful so that it can help others in the future.

Thanks,