MACROMEDIA COLDFUSION MX 7.0.2-USING COLDFUSION MX WITH FLEX 2 Use Manual page 50

Table of Contents

Advertisement

The
method calls the private methods
sync
occurs, the method updates the change object with the failure to inform the Flex application
that the change was not processed. The ChangeObject has two APIs,
. The
fail()
fail()
of what went wrong. The
<cffunction name="doCreate" access="private" output="no">
<cfargument name="co" required="yes" hint="The change object.">
<!--- The record to create. --->
<cfset var new = co.getNewVersion()>
<cftry>
<cfset dao = CreateObject("component", "samples.contact.ContactDAO")>
<!--- Create the record; create returns with the identity fields
set --->
<cfset dao.create(new)>
<!--- Set the new version in to the change object. --->
<cfset co.setNewVersion(new)>
<!--- Mark this change as processed successfully. --->
<cfset co.processed()>
<!--- If the SQL failed, mark this change with the error. --->
<cfcatch type="database">
<cfset msg = "Error during create: " & cfcatch.queryError &
". SQL was :" & cfcatch.sql>
<cfset co.fail(msg)>
</cfcatch>
<!--- If anything else happened, mark this change with the error. --->
<cfcatch type="any">
<cfset co.fail(cfcatch.message & " " & cfcatch.detail)>
</cfcatch>
</cftry>
<!--- Return the change object. --->
<cfreturn co>
</cffunction>
<cffunction name="doUpdate" access="private" output="no">
<cfargument name="co" required="yes" hint="The change object.">
<!--- The record to update. --->
<cfset var new = co.getNewVersion()>
<cfset var old = co.getPreviousVersion()>
<cftry>
<cfset dao = CreateObject("component", "samples.contact.ContactDAO")>
<!--- Update the record. --->
50
Using the Flex Data Service Assembler
API takes an optional string argument, which contains the description
,
doCreate
doUpdate
,
doCreate
doUpdate
, and
methods appear as follows:
doDelete
, and
. If an error
doDelete
and
processed()

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents