when using isDefined the variable name must be in quotes, otherwise it tries to interpret the variable before passing the value to the function
<cfif isDefined("getB.class_id")
Main Topics
Browse All TopicsI've got some logic to run or not run a query. If the query doesn't run then I don't want to show a block of cod below. I'm using the <cfif isDefined()> to test for the query. I must have this setup incorrect b/c I keep receiving the error message: Element not defined. (Element CLASS_ID is undefined in GETB.) Code below.
Thanks for help.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
A cleaner way to do this is to move your code up into the same CFIF statement was the query
<cfif listFindNoCase(request.boA
<cfloop query="getBreak">
<cfquery dbtype="query" name="getB">
select class_id, breakout_id
from getBreak
WHERE breakout_id = '#getBreakouts.breakout_id
</cfquery>
</cfloop>
Hi <!===== MOVE IS UP HERE so it only runs if the query is run
</cfif>
Or, if there is a lot of code there, go ahead and run the query but ensure it returns no values. Then you don't have to test for it's existance, just for the value....
<cfloop query="getBreak">
<cfquery dbtype="query" name="getB">
select class_id, breakout_id
from getBreak
WHERE breakout_id = '#getBreakouts.breakout_id
<cfif listFindNoCase(request.boA
AND 1 = 2 -- make sure nothing is returned
</cfif>
</cfquery>
</cfloop>
Also, I suspect this is work in progress... but you are currently looping your query again and agagin without doing anything inside the loop. I suspect you're going to add some code before the </CFLOOP> ? Otherwise it's not worth looping... right?
Business Accounts
Answer for Membership
by: SidFishesPosted on 2009-03-20 at 06:59:28ID: 23939320
check to see that this condition
dminList,s ession.use rid)>
<cfif listFindNoCase(request.boA
is being met.
the error message may actually be trying to tell you that getB is not defined ie: getB.class_id is not defined since getB isn't