Don't forget about cfinsert and cfupdate.
Something like this works nicely for inserting or updating most Flex forms:
All you need to do is pass in arguments that match your database column names.
I usually call it like this:
var args = new Object;
args.firstname = firstname.text;
args.lastname = lastname.text;
MyRO.insertItem(args);
<cffunction name="insertItem" access="remote" returntype="string">
<cfargument name="registerdate" default="#now()#">
<cftry>
<cfset StructAppend(form, arguments)>
<cfinsert tablename="preregister" datasource="#request.datasource#" >
<cfcatch type="database">
<cfreturn 'Inserted error: '>
</cfcatch>
</cftry>
</cffunction>
<cffunction name="updateItem" access="remote" returntype="string">
<cftry>
<cfset StructAppend(form, arguments)>
<cfupdate tablename="preregister"
datasource="#request.datasource#">
<cfcatch type="database">
<cfreturn 'Update error: #cfcatch.Message#'>
</cfcatch>
</cftry>
<cfreturn 'Record Updated'>
</cffunction>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU
Archive: http://www.houseoffusion.com/groups/Flex/message.cfm/messageid:3477
Subscription: http://www.houseoffusion.com/groups/Flex/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.37