= Generic Database Messages: Using modelglue.!GenericRead = When this message is broadcast, the !DataController will attempt to read a specific record from a given table. This message is configured by using the following tags: 1. Object (Required) - The name of the table from which to read. 1. !RecordName (Optional) - The name of the viewstate value to set the resultant record into. Defaults to Object & "Record". 1. Criteria (Optional) - A list of viewstate values to use as filters. Any value listed whose name matches a column in the target table will be used as a filter in the query's WHERE clause. This will most often be set to a list of the table's primary keys. If left empty, a new record will be created. == Examples == === A Basic Generic Read === To perform a basic read on a Contact table, the following tag could be added to an : {{{ }}} A View could then the record by performing the following code: {{{ }}} Note: Because no criteria were specified, this would return a new, empty record. === Customizing the Viewstate value name === To perform a basic read on a Contact table and set it into a specific value in the Viewstate, the following tag could be added to an : {{{ }}} A View could then the record by performing the following code: {{{ }}} Note: Because no criteria were specified, this would return a new, empty record. === Reading a Specific Record === To perform a basic read of a Contact record that would filter on the viewstate's current !ContactId value, the following tag could be added to an : {{{ }}} Assuming an event-handler name of "contact.read", visiting the event handler with the following URL would result in reading a contact with a !ContactId value of 42. index.cfm?event=contact.read&contactId=42