com.sebtools Build 12 Documentation: Recordset Info

Recordset Info

Components that extend Records.cfc have built-in methods for finding out about the recordsets that would be returned for given data (sung the "getRecords" method). This is easiest to see by example.

<table entity="Contact">
	<field name="ContactType" Label="Type" type="text" Length="20" />
</table>

Number of Records

The "numRecords" (or "numContacts" for our example) method will return the number of records (but not the recordset itself) for the given data.

Example:

<cfset numRedContactTypes = Application.Contacts.numContacts(ContactType="Red")>

Has Records

The "hasRecords" (or "hasContacts" for our example) method will return a boolean indicating whether or not any records exist for the given data.

Example:

<cfset hasRedContactTypes = Application.Contacts.hasContacts(ContactType="Red")>