| | 1 | = Using modelglue.!GenericDelete = |
| | 2 | |
| | 3 | When this message is broadcast, the !DataController will attempt to delete a record from a given table. |
| | 4 | |
| | 5 | This message is configured by using the following <argument> tags: |
| | 6 | |
| | 7 | 1. Object (Required) - The name of the table from which to delete. |
| | 8 | 1. Criteria (Required) - 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. |
| | 9 | |
| | 10 | == Examples == |
| | 11 | |
| | 12 | === A Basic Generic Delete === |
| | 13 | |
| | 14 | To perform a basic delete on the Contact table, the following <message> tag could be added to an <event-handler>: |
| | 15 | |
| | 16 | {{{ |
| | 17 | <message name="modelglue.GenericDelete"> |
| | 18 | |
| | 19 | <argument name="object" value="Contact" /> |
| | 20 | |
| | 21 | <argument name="contactId" value="Contact" /> |
| | 22 | |
| | 23 | </message> |
| | 24 | }}} |
| | 25 | |
| | 26 | Assuming an event-handler name of "contact.delete", visiting the event handler with the following URL would result in deleting the contact with a !ContactId of 42. |
| | 27 | |
| | 28 | index.cfm?event=contact.delete&contactId=42 |