Loads and returns an array of entities of the specified entityname or an entity if unique=true or if a primary key id is passed in to filterCriteria.

entityLoad(entityName [, filterCriteria] [, unique]) entityLoad(entityName [, filterCriteria] [, sortOrder] [, options]) → returns any

entityLoad Argument Reference

entityName string

Name of CFC / Entity

filterCriteria any

A struct of key value pairs, or a primary key value

unique boolean

When true a single entity is returned, otherwise an array

sortOrder string

Column name and direction list, eg: LastName ASC, FirstName ASC

options struct

A struct with possible keys: ignorecase, sortorder, offset, maxresults, cacheable, cachename, timeout

Examples sample code invoking the entityLoad function

Loads an entity by primary key value

entityLoad("Employee", url.employee_id)

Expected Result: An Employee CFC Instance

Returns an array of Employee instances with last name Smith

entityLoad("Employee", {LastName="Smith"})

Expected Result: array

Fork me on GitHub