Re: Dynamic Query Name in Custom Tag?
Hi Dan, Try the following... cfif variables[ 'ConvertedFields_' attributes.QueryName'].RecordCount GT 0 You were including the RecordCount attribute as a part of the variable name (Inside the square brackets). Good luck, Jack Traynor On Wed, May 28, 2014 at 8:12 AM, Dan LeGate d...@legeek.com wrote: Thanks Matt! That worked for cfdump. Now I'm trying to cfif for the RecordCount and neither: cfif variables[ 'ConvertedFields_' attributes.QueryName.RecordCount' ] GT 0 nor cfif variables[ 'ConvertedFields_' attributes.QueryName '.RecordCount' ] GT 0 works. Any advice on this one? Getting Element QUERYNAMES.RECORDCOUNT is undefined in ATTRIBUTES. and Element ConvertedFields_GetLDAPInfo.RecordCount is undefined in a Java object of type class coldfusion.runtime.VariableScope referenced respectively. Thanks again. Dan On 5/27/2014 1:55 PM, Matt Quackenbush wrote: Trycfdump var=#variables[ 'ConvertedFields_' attributes.QueryName ]# On Tue, May 27, 2014 at 4:49 PM, Dan LeGated...@legeek.com wrote: Hi all, I'm attempting to create a dynamic query name inside a Custom Tag. It seems to get created fine, but referencing it seems to be the problem. Here's where I set it up: cfquery name=ConvertedFields_#attributes.QueryName# dbtype=query So, yes, it's a Query of Query, if that makes a difference. But when I try to reference it later, like this: cfdump var=ConvertedFields_#attributes.QueryName# or cfdump var=#ConvertedFields_[attributes.QueryName]# or cfdump var=#ConvertedFields_['#attributes.QueryName#']# It always errors out with Variable CONVERTEDFIELDS_ is undefined. I know I'm missing something simple here. My brain is not recalling how to handle these. :-) Any help is appreciated. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358697 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Dynamic Query Name in Custom Tag?
Sorry I left a comma in there, it should be... cfif variables[ 'ConvertedFields_' attributes.QueryName].RecordCount GT 0 On Wed, May 28, 2014 at 5:07 PM, Jack Traynor traynor.j...@gmail.comwrote: Hi Dan, Try the following... cfif variables[ 'ConvertedFields_' attributes.QueryName'].RecordCount GT 0 You were including the RecordCount attribute as a part of the variable name (Inside the square brackets). Good luck, Jack Traynor On Wed, May 28, 2014 at 8:12 AM, Dan LeGate d...@legeek.com wrote: Thanks Matt! That worked for cfdump. Now I'm trying to cfif for the RecordCount and neither: cfif variables[ 'ConvertedFields_' attributes.QueryName.RecordCount' ] GT 0 nor cfif variables[ 'ConvertedFields_' attributes.QueryName '.RecordCount' ] GT 0 works. Any advice on this one? Getting Element QUERYNAMES.RECORDCOUNT is undefined in ATTRIBUTES. and Element ConvertedFields_GetLDAPInfo.RecordCount is undefined in a Java object of type class coldfusion.runtime.VariableScope referenced respectively. Thanks again. Dan On 5/27/2014 1:55 PM, Matt Quackenbush wrote: Trycfdump var=#variables[ 'ConvertedFields_' attributes.QueryName ]# On Tue, May 27, 2014 at 4:49 PM, Dan LeGated...@legeek.com wrote: Hi all, I'm attempting to create a dynamic query name inside a Custom Tag. It seems to get created fine, but referencing it seems to be the problem. Here's where I set it up: cfquery name=ConvertedFields_#attributes.QueryName# dbtype=query So, yes, it's a Query of Query, if that makes a difference. But when I try to reference it later, like this: cfdump var=ConvertedFields_#attributes.QueryName# or cfdump var=#ConvertedFields_[attributes.QueryName]# or cfdump var=#ConvertedFields_['#attributes.QueryName#']# It always errors out with Variable CONVERTEDFIELDS_ is undefined. I know I'm missing something simple here. My brain is not recalling how to handle these. :-) Any help is appreciated. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358698 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Calling a Custom Tag Twice Duplicates Query Results?
Okay, so I've been trying to solve a problem I'm having with a Custom Tag I wrote to do ldap lookups. The QueryName attribute gets passed in, along with a FilterValue. My problem is that when I call this tag twice or more within one page, the results of the FIRST lookup seem to stick and the second lookup doesn't work First lookup: value of NetID is ab1234 cf_ldap_lookup QueryName = GetLDAPInfo FilterName = UserID FilterValue= #NetID# UserID = Yes FullName = Yes LastName = Yes FirstName = Yes Department = Yes EmplID = Yes StaffEmail = Yes Second lookup: value of NetID is xy6789 cf_ldap_lookup QueryName = GetLDAPInfoContact FilterName = UserID FilterValue= #NetID# UserID = Yes FullName = Yes LastName = Yes FirstName = Yes Department = Yes EmplID = Yes StaffEmail = Yes When I reference #GetLDAPInfoContact.FirstName# it contains the value for #GetLDAPInfo.FirstName# Is there some sort of caching happening when a Custom Tag is called more than once? This is CFMX 7, btw. :-\ I thought by dynamically changing the Query Name value within the Custom Tag it would solve this (it used to be the same query name each time the Custom Tag was called), but that wasn't it. Any insight is appreciated. Thanks! ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358699 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Calling a Custom Tag Twice Duplicates Query Results?
Considering we don't see the tag code, I would suspect it's because all the options for it are exactly the same. So it's running the same query. This is CFMX 7, btw. :-\ Also, it's either MX or 7. :) On Wed, May 28, 2014 at 11:50 AM, Dan LeGate d...@legeek.com wrote: Okay, so I've been trying to solve a problem I'm having with a Custom Tag I wrote to do ldap lookups. The QueryName attribute gets passed in, along with a FilterValue. My problem is that when I call this tag twice or more within one page, the results of the FIRST lookup seem to stick and the second lookup doesn't work First lookup: value of NetID is ab1234 cf_ldap_lookup QueryName = GetLDAPInfo FilterName = UserID FilterValue= #NetID# UserID = Yes FullName = Yes LastName = Yes FirstName = Yes Department = Yes EmplID = Yes StaffEmail = Yes Second lookup: value of NetID is xy6789 cf_ldap_lookup QueryName = GetLDAPInfoContact FilterName = UserID FilterValue= #NetID# UserID = Yes FullName = Yes LastName = Yes FirstName = Yes Department = Yes EmplID = Yes StaffEmail = Yes When I reference #GetLDAPInfoContact.FirstName# it contains the value for #GetLDAPInfo.FirstName# Is there some sort of caching happening when a Custom Tag is called more than once? This is CFMX 7, btw. :-\ I thought by dynamically changing the Query Name value within the Custom Tag it would solve this (it used to be the same query name each time the Custom Tag was called), but that wasn't it. Any insight is appreciated. Thanks! ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358700 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm