Accessibility

TechNote (Archived)

Verity compatibility issue with cfindex action=delete between ColdFusion 5 and ColdFusion MX

Issue


In ColdFusion 5, when deleting from a Verity collection, you could pass a value as the key, as in the following example:

<cfindex action="DELETE" collection="#collection#" key="#key#">

In ColdFusion MX and above, passing a value as a key will no longer work.

Reason


This change in behavior is logged as Macromedia issue 56014.

Solution


When deleting from a Verity collection in ColdFusion MX and above, you MUST pass key as a column name and pass a query in.

This means if you want to delete one item, you need to create a temporary query to store the value. The following example demonstrates the required syntax:

 <cfset data = queryNew("title")><cfset queryAddRow(data)><cfset querySetCell(data,"title",key)> (Note: "key" is a variable    that represents the key you want to delete from the index)<cfindex action="DELETE" collection="#collection#" key="title" query="data"> 

AlertThis content requires Flash

To view this content, JavaScript must be enabled, and you need the latest version of the Adobe Flash Player.

Download the free Flash Player now!

Get Adobe Flash Player

Creative Commons License

Search Support

Document Details

ID:1d5dc22

Products Affected:

coldfusion