ColdFusion Help with update statement
Posted on 2014-03-01
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]>
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?