Hello all,
 
New to Reactor and looking for some validation that this is a correct pattern for cloning a record using a transfer object :
 
<!--- get original record --->
<cfset SourceRecord = Reactor.createRecord("mytable").load(mytableID=3178) />

<!--- create new record --->
<cfset NewRecord = Reactor.createRecord("mytable") />

<!--- init with the data of the original record --->
<cfset NewRecord._getTo()._Copy(SourceRecord ._getTo()) />
 
<!--- change something in the new record --->
<cfset NewRecord.setRecord_Name("Send in the clones") />
<cfset NewRecord.save() />
 
Is there a better way ?
 
Thanks in advance.
 
Matt Hall-Smith
 
Pauaware Information Architects
 

 


-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
reactor@doughughes.net
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Reply via email to