hahaha.. thanks alot
I think you'll need to load the record first; otherwise every field that you don't set will be saved with its default value.
Also, if you're loading on each iteration, you won't need to create a fresh record each time.
<cfset taskRecord = application.reactor.createRecord("task")>
<cfloop list="#form.task#" index="thetask" delimiters=","><cfset taskRecord.load(taskId=thetask)>
<cfset taskRecord.setCompleted(1)>
<cfset taskRecord.save ()>
</cfloop>
Chris
From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED]] On Behalf Of Dan Vega
Sent: 10 July 2006 22:52
To: [email protected]
Subject: [Reactor for CF] reactor record save()
Quick question, when you do a save it looks as if reactor figures out if you are creating or updaing.
if i do this
example form.task = "10,14,25,32"
<cfloop list="#form.task#" index="thetask" delimiters=",">
<cfset taskRecord = application.reactor.createRecord("task")>
<cfset taskRecord.setTaskId(thetask)>
<cfset taskRecord.setCompleted(1)>
<cfset taskRecord.save ()>
</cfloop>
Do you have to update all the fields? When i do the above completed gets set to 1 and every field gets set to 0.
--
Dan Vega
[EMAIL PROTECTED]
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
Dan Vega
[EMAIL PROTECTED]
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
