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
priyanshu chaudharypriyanshu chaudhary 

Clone(false,true,false,false) not cloning all field value.

Hi All,

I am using clone() method in my apex code to create account record with following configuration: 

Account newAccount = oldAccount.Clone(false,true,false,false);   (This oldAccount record I got from afterUpdate event trigger newMap variable where isCustomerPortal value on )

I am expecting it will copy all field value in cloned record.

Then I am updating the record type on newAccount (I have multiple record type) to different.

And then inserting newAccount. But the new record don't keep value for "isCustomerPortal"  (My oldAccount have isCustomerPortal=TRUE).

Can some body suggest what's going wrong ?