You need to sign in to do that
Don't have an account?
TechMighty
Autonumber field value not preserved when inserting cloned record
Hi,
Can anybody please help to understand "Boolean opt_preserve_autonumber" parameter of clone method?
I am trying to create a cloned object of account object but there is an autonumber field "Account Number". When I set this parameter value to true i could see that the cloned object hold the same old value but when I try to inser the same cloned record the value changes automatically to next autonumber value.
can this be avoided?
Regards,
Suyog
After cloning why are you still trying to insert that data?
If you insert it separately it will invoke new autonumber value automatically.
Thanks
Hi,
If we dont need to insert cloned record explicitly, then how can i ensure that the object instance is saved in the salesforce?
I mean how can i ensure that the cloned record is stored properly?
Regards,
Suyog
Please refer below
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_database_saveresult.htm
Hi,
I went through the link, but i can see that Database.SaveResult[] class is the outcome of either insert or update method call.
When we clone an object using this statement "Account__c acc_clone = accobj.clone(false,true,true,true);" how can i save cloned object (acc_clone)?
I want to save all the changes to made to clone object and am using custome page for navigations.