An easy way to debug this is to dump the form scope and see what's going on.

<cfdump var="#FORM#">
<cfabort>

Adrian

-----Original Message-----
From: Renee Spadaro
Sent: 25 January 2008 16:20
To: CF-Newbie
Subject: Java object error


Hi,

I am trying to update a sql table by looping through records.  I have been
reading a bunch of stuff here and tried different things but I keep getting
the same error:

Element cyeID1 is undefined in a Java object of type class
coldfusion.filter.FormScope referenced as

My code is this:

<!--- Save the data --->
<cfif form.FormAction is "Save">
        <cfloop from="1" to="#form.Records#" index="ii">
          <!--- Define variables --->
          <cfparam name="form.#Earnings&ii#" type="integer" default="0">
          <!--- Get the ID of the person and the earnings from the form --->
          <cfset variables.thisId = form["cyeID"&ii]/>
          <cfset variables.thisRate = form["Earnings"&ii]/>
          <!--- Update each record with the new earnings --->
          <cfquery name="saveData" datasource="cs-arch-apps">
                 UPDATE tbCalendarYearEarnings
                 SET Earnings = <cfqueryparam value="#variables.thisRate#"
cfsqltype="cf_sql_integer">
                 WHERE cyeID = <cfqueryparam value="#variables.thisId#"
cfsqltype="cf_sql_integer">
          </cfquery>
        </cfloop>
</cfif>

There are three pieces of data displayed on this form:
Employee Number (cyeID)
Name
Earnings (Earings)

I have a hidden field to get the row count.  I've trying this with two
records just to see if it works.

Also, there is a hidden field (FormAction) which equals save.

I've been reading about java objects.  Do i need to add a <cfobject> tag
here somewhere and create the java class?

Thanks for the help,
Renee


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:3261
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to