Link to home
Start Free TrialLog in
Avatar of D J
D JFlag for United States of America

asked on

ColdFusion Help with update statement

I have a working update statement that updates more than one record at a time (with one table) and need to alter to accommodate another table of alterations, meaning some records of the main table have a alteration record attached and some don't.

I'm using counter for multiple inputs:
<cfloop from="1" to="#form.numOfFields#" index="counter">
       <!--- extract values of form fields --->
       <cfset variables.keyID   = FORM["keyid_"& counter]>
       <cfset variables.date = FORM["date_"& counter]>
Problem:
When I added this statement, to receive inputs for the alteration table, I receive errors due to not all records from the main table, have records from the alteration table:
      <cfset variables.AlterationTabledate = FORM["REC_DATE_B"& counter]>
This statement works when all records being displayed have an alteration record.

Error received if all records displayed do not have an alteration record:
Element DATE_B2 is undefined in a Java object of type class coldfusion.filter.FormScope.

How can I make this update statement work when not all records of the main table have an alternate record attached?
ASKER CERTIFIED SOLUTION
Avatar of _agx_
_agx_
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of D J

ASKER

Plan b worked perfectly - thanks!