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

Table of Contents

Advertisement

Creating the count method
The
method returns the number of records that would be returned by the fill method.
count
The return type of the
<cffunction name="count" output="no"
returntype="samples.contact.Contact[]" access="remote">
<cfargument name="param" type="string" required="no">
<cftry>
<cfset dao = CreateObject("component", "samples.contact.ContactDAO")>
<cfif structKeyExists(arguments, "param")>
<cfreturn dao.count(param=arguments.param)>
<cfelse>
<cfreturn dao.count()>
</cfif>
<!--- If the SQL failed, mark this change with the error. --->
<cfcatch type="database">
<cfset msg = "Error during count: " & 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>
</cffunction>
52
Using the Flex Data Service Assembler
method is numeric. It appears as follows:
count

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION MX 7.0.2-USING COLDFUSION MX WITH FLEX 2 and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Coldfusion mx

Table of Contents