Error in my link with coldfusion

I'm getting this error in my hyperlink and I'm not sure whats causing it.  Whats weird is the hyperlink is displaying all the data as follows:

http://mymobisaver.com/detailcoupon.cfm?CFGRIDKEY=43,Slender%20U%20Spa,Receive%2010%25%20off%20any%20Spa%20Package,Chardon,02-28-12

Here is the error:
<cfform name="CouponForm">
              <cfgrid name="parkGrid" style="" selectmode="row" format="HTML" pagesize="8" width="580" bind="cfc:listCoups.restaurants({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection})">
                <cfgridcolumn name="Cid" header="id" display="no">
                <cfgridcolumn name="businessName" width="200" header="Business Name" href="detailcoupon.cfm" hrefkey="id"/>
                <cfgridcolumn name="cDescription" width="200" header="Coupon" href="detailcoupon.cfm" hrefkey="id"/>
                <cfgridcolumn name="city" width="110" header="City" href="detailcoupon.cfm" hrefkey="id"/>
                <cfgridcolumn name="NEWexpDate" width="70" header="Exp Date" href="detailcoupon.cfm" hrefkey="id"/>
              </cfgrid>
            </cfform>
Here is the actual code:

<cfform name="CouponForm">
              <cfgrid name="parkGrid" style="" selectmode="row" format="HTML" pagesize="8" width="580" bind="cfc:listCoups.restaurants({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection})">
                <cfgridcolumn name="Cid" header="id" display="no">
                <cfgridcolumn name="businessName" width="200" header="Business Name" href="detailcoupon.cfm" hrefkey="id"/>
                <cfgridcolumn name="cDescription" width="200" header="Coupon" href="detailcoupon.cfm" hrefkey="id"/>
                <cfgridcolumn name="city" width="110" header="City" href="detailcoupon.cfm" hrefkey="id"/>
                <cfgridcolumn name="NEWexpDate" width="70" header="Exp Date" href="detailcoupon.cfm" hrefkey="id"/>
              </cfgrid>
            </cfform>

Open in new window

sonicimpulseAsked:
Who is Participating?
 
_agx_Commented:
>If I change it to hrefkey I get the following error:

Ignore that comment. It was before I realized the query column name was wrong ie "id" instead of "cid".  If you use "CID" instead of "id", what does the URL look like?

<cfgridcolumn name="businessName" width="200" header="Business Name" href="detailcoupon.cfm" hrefkey="CID"/>

0
 
_agx_Commented:
Can you repost the error? It didn't come through.
0
 
sonicimpulseAuthor Commented:
I posted the error below.  I understand what the error is.  I just don't understand why the link contains all that data.  It should only contain the HREFKEY="id"

Invalid data '' for CFSQLTYPE CF_SQL_NUMERIC.  
The error occurred in D:\home\mymobisaver.com\wwwroot\detailcoupon.cfm: line 41
 
39 : FROM member, coupon
40 : WHERE coupon.memberid=member.id and
41 : coupon.id=<cfqueryparam value="#url.recordid#" cfsqltype="cf_sql_numeric">
42 :  
43 :   </cfquery>

 
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
nap0leonCommented:
Getting this error now - looks like #url.recordid# is returning "" instead of a number.
Invalid data '' for CFSQLTYPE CF_SQL_NUMERIC.
 
The error occurred in D:\home\mymobisaver.com\wwwroot\detailcoupon.cfm: line 41

39 : FROM member, coupon
40 : WHERE coupon.memberid=member.id and
41 : coupon.id=<cfqueryparam value="#url.recordid#" cfsqltype="cf_sql_numeric">
42 :  
43 :   </cfquery>

Open in new window

0
 
_agx_Commented:
> coupon.id=<cfqueryparam value="#url.recordid#"

In the url the variable name is CFGRIDKEY not recordID.

ie http://mymobisaver.com/detailcoupon.cfm?CFGRIDKEY=43,Slender%20U%20Spa,Receive%2010%25%20off%20any%20Spa%20Package,Chardon,02-28-12
0
 
_agx_Commented:
Oh wait  .. the code is using href="id", but the name of the query column is actually "CID".
0
 
sonicimpulseAuthor Commented:
If I change it to hrefkey I get the following error:

Element HREFKEY is undefined in URL.
0
 
sonicimpulseAuthor Commented:
Its weird.  Most have been some update that changed the way this code works.  Everything worked yesterday and today I'm getting error messages everywhere.
0
 
_agx_Commented:
I'm not near a cf install to test it.  What updates did you apply recently?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.