• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

cfloop error

New Here ,
May 30, 2007 May 30, 2007

Copy link to clipboard

Copied

Ive never used cfloop like this before i followed advice from another member of this forum and got this error.
This is an edit function with a drop down. if the user selects Acid and then edits it the menu reverts to the first thing in the list not the one they had previously selected.

The error:

Complex object types cannot be converted to simple values.
The expression has requested a variable or an intermediate expression result as a simple value, however, the result cannot be converted to a simple value. Simple values are strings, numbers, boolean values, and date/time values. Queries, arrays, and COM objects are examples of complex values.
The most likely cause of the error is that you are trying to use a complex value as a simple one. For example, you might be trying to use a query variable in a <CFIF> tag. This was possible in ColdFusion 2.0 but creates an error in later versions.


The Code

The drop down menu query
<cfinvoke component="0-waste.sitewisecfc.getcategory"
method="getCategory" returnvariable="qry_getCategory">
</cfinvoke>


<cfquery name="GetPollutant" datasource="#db#">
SELECT *
FROM tblPollutant
WHERE StoryID = #StoryID# AND EBID = #EBID#
</cfquery>

<select name="EBCategory">
<cfloop query="qry_getCategory">
<option value="#industry_id#" <cfif #Getpollutant.EBCategory# EQ #qry_getCategory#>
selected</cfif>>#pollutant_type#</option>
</cfloop>
</select>

Any ideas?
TOPICS
Advanced techniques

Views

185

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
May 30, 2007 May 30, 2007

Copy link to clipboard

Copied

LATEST
You're trying to compare a simple value to a query object: #qry_getCategory#. Try adding the column name

<cfif Getpollutant.EBCategory EQ qry_getCategory.SomeColumnName >
....



Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation