Skip to main content
Participant
July 21, 2011
Question

CF5 Sever to CF8 Server problem with one page!

  • July 21, 2011
  • 2 replies
  • 688 views

Hi

Have changed from CF5 server to CF8 server. Everything works so far except for one page.

This is the error below that I get:
------------------------------------------------------------------------------------
struct
BTNEDIT_OK       OK
BUSINESS_ID      188
COMPANY_NAME     x
COUNTRY_ID       13
DEBTOR_TYPE      1
DOB_DAY  Day
DOB_MONTH        Month
DOB_YEAR         Year
EMAIL    1
ENTITY_ID        1
FIELDLIST        business_id,first_name,middle_name,last_name,date_of_birth,debtor_type,company_name,entity_id,trading_name,phone_prefix,phone,mobile,email,postal_address,postal_suburb,postal_city,postcode,last_modified,times_used,recoverable_costs,data_checked,country_id,state
FIELDNAMES       FIELDLIST,FIRST_NAME,MIDDLE_NAME,LAST_NAME,DOB_DAY,DOB_MONTH,DOB_YEAR,DEBTOR_TYPE,COMPANY_NAME,ENTITY_ID,TRADING_NAME,PHONE,MOBILE,EMAIL,POSTAL_ADDRESS,POSTAL_SUBURB,POSTAL_CITY,POSTCODE,COUNTRY_ID,TIMES_USED,BUSINESS_ID,BTNEDIT_OK
FIRST_NAME       [empty string]
LAST_NAME        [empty string]
MIDDLE_NAME      [empty string]
MOBILE   1
PHONE    1
POSTAL_ADDRESS   1
POSTAL_CITY      1
POSTAL_SUBURB    1
POSTCODE         1
TIMES_USED       0
TRADING_NAME     [empty string]

The FIELDLIST column cannot be found in the DEBTORS table.

FIELDLIST,FIRST_NAME,MIDDLE_NAME,LAST_NAME,DOB_DAY,DOB_MONTH,DOB_YEAR,DEBTOR_TYPE,COMPANY_NAME,ENTITY_ID,TRADING_NAME,PHONE,MOBILE,EMAIL,POSTAL_ADDRESS,POSTAL_SUBURB,POSTAL_CITY,POSTCODE,COUNTRY_ID,TIMES_USED,BUSINESS_ID,BTNEDIT_OK

------------------------------------------------------------------------------------

The error "The FIELDLIST column cannot be found in the DEBTORS table", is odd as there is no column in my debtors table named that. It appears that CF8 is searching through all my field names and looking for them in the debtors database.

Below is a copy of the page in question. I think this may need to be updated to work with CF8. Any help would be appreciated.

------------------------------------------------------------------------------------

<script language="javascript">
function goDelete() {
       if (confirm("Are you sure you want to delete this record?\nDeletion cannot be undone.")) {
               document.frmEdit.action="index.cfm?fuseaction=DEBTORS_RecordAction&delete=y";
               document.frmEdit.submit();
       }
}
function goDeleteFail() {
       alert('There are invoice sets against this debtor, deletion is not allowed.');
}
</script>
       <cfquery username="edebt" password="D7Oe+lus" name="GetCOUNTRY" dataSource="#request.dsn#">
               SELECT  *
               FROM    COUNTRY
       </cfquery>

<CFSET FormFieldList = "business_id,first_name,middle_name,last_name,date_of_birth,debtor_type,company_name,entity_id,trading_name,phone_prefix,phone,mobile,email,postal_address,postal_suburb,postal_city,postcode,last_modified,times_used,recoverable_costs,data_checked,country_id,state">




<CFIF ParameterExists(URL.debtor_id)>
       <cfquery username="edebt" password="D7Oe+lus" name="GetRecord" dataSource="#request.dsn#" maxRows=1>
               SELECT DEBTORS.business_id,
                                               DEBTORS.first_name,
                                               DEBTORS.middle_name,
                                               DEBTORS.last_name,
                                               DEBTORS.date_of_birth,
                                               Debtors.debtor_type,
                                               DEBTORS.company_name,
                                               DEBTORS.entity_id,
                                               DEBTORS.trading_name,
                                               DEBTORS.phone_prefix,
                                               DEBTORS.phone,
                                               DEBTORS.mobile,
                                               DEBTORS.email,
                                               DEBTORS.recoverable_costs,
                                               DEBTORS.postal_address,
                                               DEBTORS.postal_suburb,
                                               DEBTORS.postal_city,
                                               DEBTORS.postcode,
                                               DEBTORS.last_modified,
                                               DEBTORS.customer_note ,
                                               DEBTORS.times_used,
                                               DEBTORS.data_checked,
                                               DEBTORS.debtor_id AS ID_Field,
                                               DEBTORS.state,
                                               DEBTORS.country_id
               FROM DEBTORS

               <CFIF ParameterExists(URL.debtor_id)>
               WHERE DEBTORS.debtor_id = #URL.debtor_id#
               </CFIF>
       </CFQUERY>
       <cfquery username="edebt" password="D7Oe+lus" name="x_business" dataSource="#request.dsn#" maxRows=1>
               SELECT  BUSINESSES.COUNTRY_ID
               FROM    BUSINESSES
               WHERE   BUSINESSES.business_id =#GetRecord.business_id#
       </CFQUERY>
   <cfquery username="edebt" password="D7Oe+lus" name="Orders" dataSource="#request.dsn#" maxRows=1>
               SELECT *
               FROM Business_orders
               WHERE business_id = #GetRecord.business_id#
       </CFQUERY>
       <CFIF not ListFind( FormFieldList, "debtor_id" )>
               <CFSET FormFieldList = ListAppend( FormFieldList, "debtor_id" )>
       </CFIF>
               <CFSET business_id_Value = #GetRecord.business_id#>
               <CFSET first_name_Value = '#GetRecord.first_name#'>
               <CFSET middle_name_Value = '#GetRecord.middle_name#'>
               <CFSET last_name_Value = '#GetRecord.last_name#'>
               <CFSET debtor_type_Value = '#GetRecord.debtor_type#'>
               <CFSET company_name_Value = '#GetRecord.company_name#'>
               <CFSET entity_id_Value = #GetRecord.entity_id#>
               <CFSET trading_name_Value = '#GetRecord.trading_name#'>
               <CFSET phone_prefix_Value = '#GetRecord.phone_prefix#'>
               <CFSET phone_Value = '#GetRecord.phone#'>
               <CFSET mobile_Value = '#GetRecord.mobile#'>
               <CFSET email_Value = '#GetRecord.email#'>
               <CFSET recoverable_costs_Value_chk = GetRecord.recoverable_costs>
               <CFSET postal_address_Value = '#GetRecord.postal_address#'>
               <CFSET postal_suburb_Value = '#GetRecord.postal_suburb#'>
               <CFSET postal_city_Value = '#GetRecord.postal_city#'>
               <CFSET postcode_Value = '#GetRecord.postcode#'>
               <CFSET last_modified_Value = #GetRecord.last_modified#>
               <CFSET times_used_Value = #GetRecord.times_used#>
               <CFSET customer_note_value = '#GetRecord.customer_note#'>
               <CFSET data_checked_value = '#GetRecord.data_checked#'>
               <cfset heading = "Edit " & company_name_Value & "'s Details">
               <cfset State_Value = GetRecord.State>
               <cfset COUNTRY_ID_value = GetRecord.COUNTRY_ID>



<CFELSE>
       <cfquery username="edebt" password="D7Oe+lus" name="x_business" dataSource="#request.dsn#" maxRows=1>
               SELECT  BUSINESSES.COUNTRY_ID
               FROM    BUSINESSES
               WHERE   BUSINESSES.business_id =#session.business_id#
       </CFQUERY>
               <CFSET business_id_Value = '#session.business_id#'>
               <CFSET first_name_Value = ''>
               <CFSET debtor_type_Value = '0'>
               <CFSET middle_name_Value = ''>
               <CFSET last_name_Value = ''>
               <CFSET company_name_Value = ''>
               <CFSET entity_id_Value = '1'>
               <CFSET trading_name_Value = ''>
               <CFSET phone_prefix_Value = '09'>
               <CFSET phone_Value = ''>
               <CFSET mobile_Value = ''>
               <CFSET email_Value = ''>
               <CFSET recoverable_costs_Value_chk = 0>
               <CFSET postal_address_Value = ''>
               <CFSET postal_suburb_Value = ''>
               <CFSET postal_city_Value = ''>
               <CFSET postcode_Value = ''>
               <CFSET last_modified_Value = ''>
               <CFSET times_used_Value = '0'>
               <CFSET customer_note_value = ''>
               <CFSET data_checked_value ='0'>
               <cfset heading = "Add a New Debtor">
               <cfset State_Value = ''>
               <cfset COUNTRY_ID_value = x_business.COUNTRY_ID>
</CFIF>


<table border="0" cellspacing="0" cellpadding="5" width=560 align=center>
<cfform action="index.cfm?fuseaction=DEBTORS_RecordAction" method="POST" name="frmEdit">
<CFOUTPUT>
<INPUT type="hidden" name="FieldList" value="#FormFieldList#"><!------>
<CFIF ParameterExists(URL.debtor_id)>
       <INPUT type="hidden" name="debtor_id" value="#URL.debtor_id#">
</CFIF>
       <tr>
               <td align="left" colspan=2><FONT face=Verdana,Arial,Helvetica,sans-serif color=##cc0000 size=3><B>#heading#</b></TD>
       </tr>
       <tr>
               <td align="left" colspan=2><FONT face=Verdana,Arial,Helvetica,sans-serif color=##cc0000 size=2><B>Required fields are indicated with a "*"</b></TD>
       </tr>

       <cfif ParameterExists(url.debtor_id)>
               <cfif NOT debtor_type_value>
               <TR>
                       <TD class="contactadminsmall" valign="top" width="180" align="left"><nobr><span class="redtext">*</span>First Name:</TD>
                       <TD class="contactadminsmall" align="left" valign="top">#first_name_Value# </TD>
               </TR>
               <cfelse>
                       <TR>
                       <TD class="contactadminsmall" valign="top" width="180" align="left"><nobr><span class="redtext">*</span>First Name(not essential if company):</TD>
                               <TD class="contactadminsmall" align="left" valign="top"><INPUT type="text" size="35" name="first_name" value="#first_name_Value#" maxLength="400"  class="button"></TD>
                       </TR>
               </cfif>
       <cfelse>
       <TR>
                       <TD class="contactadminsmall" valign="top" width="180" align="left"><nobr><span class="redtext">*</span>First Name(not essential if company):</TD>
       <TD class="contactadminsmall" align="left" valign="top"><INPUT type="text" size="35" name="first_name" value="#first_name_Value#" maxLength="400" class="button"></TD>
       </TR>
       </cfif>
       <cfif ParameterExists(url.debtor_id)>
               <cfif NOT debtor_type_value>
                       <TR>
                               <TD class="contactadminsmall" valign="top" width="180" align="left">Middle Name:</TD>
                               <TD class="contactadminsmall" align="left" valign="top">#middle_name_Value#</TD>
                       </TR>
               <cfelse>
                       <TR>
                                       <TD class="contactadminsmall" valign="top" width="180" align="left"><nobr>Middle Name:</TD>
                       <TD class="contactadminsmall" align="left" valign="top"><INPUT type="text" size="35" name="middle_name" value="#middle_name_Value#" maxLength="400" class="button"></TD>
                       </TR>
               </cfif>
       <cfelse>
       <TR>
                       <TD class="contactadminsmall" valign="top" width="180" align="left"><nobr>Middle Name:</TD>
       <TD class="contactadminsmall" align="left" valign="top"><INPUT type="text" size="35" name="middle_name" value="#middle_name_Value#" maxLength="400" class="button"></TD>
       </TR>
       </cfif>
       <cfif ParameterExists(url.debtor_id)>
               <cfif NOT debtor_type_value>
                       <TR>
                               <TD class="contactadminsmall" valign="top" width="180" align="left"><nobr><span class="redtext">*</span>Last Name:</TD>
                               <TD class="contactadminsmall" align="left" valign="top">#last_name_Value#</TD>
                       </TR>
               <cfelse>
                       <TR>
                               <TD class="contactadminsmall" valign="top" width="180" align="left"><nobr><span class="redtext">*</span>Last Name(not essential if company):</TD>
                               <TD class="contactadminsmall" align="left" valign="top"><INPUT type="text" size="35" name="last_name" value="#last_name_Value#" maxLength="400" class="button"></TD>
                       </TR>
               </cfif>
       <TR>
                       <TD class="contactadminsmall" valign="top" width="180" align="left"><nobr><span class="redtext"></span>Date of Birth(only applies to individuals):</TD>
       <TD class="contactadminsmall" align="left" valign="top">#dateFormat(getrecord.date_of_birth)#</TD>
       </TR>
       <cfelse>
       <TR>
                       <TD class="contactadminsmall" valign="top" width="180" align="left"><nobr><span class="redtext">*</span>Last Name(not essential if company):</TD>
   <TD class="contactadminsmall" align="left" valign="top"><INPUT type="text" size="35" name="last_name" value="#last_name_Value#" maxLength="400" class="button"></TD>
       </TR>
       <TR>
                       <TD class="contactadminsmall" valign="top" width="180" align="left"><nobr><span class="redtext"></span>Date of Birth(only applies to individuals):</TD>
   <TD>
               <CFSET months="January,February,March,April,May,June,July,August,September,October,November,December">
               <CFSET monthsInts="1,2,3,4,5,6,7,8,9,10,11,12">
               <cfset start_date = DateAdd("yyyy",-101,NOW())>
             <SELECT NAME="dob_Day">
             <OPTION VALUE="Day">Day</option>
                 <CFLOOP INDEX="d" from="1" to="31">
                    <OPTION VALUE="#d#" >#d#</option>
                 </cfloop>
                </select>
                 <SELECT NAME="dob_Month">
                       <OPTION VALUE="Month">Month</option>
                    <CFLOOP INDEX="m" from="1" to="12">
                    <OPTION VALUE="#m#">#m#</option>
                     </cfloop>
                 </select>
                 <SELECT NAME="dob_Year">
                       <OPTION VALUE="Year">Year</option>
                    <CFLOOP INDEX="y" from="#DatePart("yyyy",start_date)#" to="#DatePart("yyyy",Now())#">
                    <OPTION VALUE="#y#">#y#</option>
                     </cfloop>
                </select>
       </TD>
       </TR>
       </cfif>
       <TR>
                       <TD class="contactadminsmall" valign="top" width="180" align="left"><nobr><span class="redtext">*</span>Debtor Type:</TD>
       <TD class="contactadminsmall" align="left" valign="top">Company:<input type="radio" name="debtor_type" value="1" <cfif debtor_type_value eq 1>Checked</cfif>><br>
          Individual:<input type="radio" name="debtor_type" value="0" <cfif debtor_type_value eq 0>Checked</cfif>>
       </TD>
  </TR>
       <cfif ParameterExists(url.debtor_id)>
               <cfif NOT debtor_type_value>
               <TR>
                       <TD class="contactadminsmall" valign="top" width="180" align="left"><nobr><span class="redtext">*</span>Company Name:(leave blank if the debtor is an individual)</TD>
                       <TD class="contactadminsmall" align="left" valign="top"><INPUT type="text" size="35" name="company_name" value="#company_name_Value#" maxLength="400" class="button"></TD>
               </TR>
               <cfelse>
                       <TR>
                       <TD class="contactadminsmall" valign="top" width="180" align="left"><nobr><span class="redtext">*</span>Company Name:</TD>
                               <TD class="contactadminsmall" align="left" valign="top">#company_name_Value#</TD>
                       </TR>
               </cfif>
       <cfelse>
               <TR>
                       <TD class="contactadminsmall" valign="top" width="180" align="left"><nobr><span class="redtext">*</span>Company Name:(leave blank if the debtor is an individual)</TD>
                       <TD class="contactadminsmall" align="left" valign="top"><INPUT type="text" size="35" name="company_name" value="#company_name_Value#" maxLength="400" class="button"></TD>
               </TR>
       </cfif>

       <TR>
                       <TD class="contactadminsmall" valign="top" width="180" align="left"><span class="redtext">*</span>Entity Type<br>(not required if individual selected, unless they are a sole trader or in a partnership):</TD>
   <TD class="contactadminsmall" align="left" valign="top"><input type="radio" name="entity_id" value="1" <cfif entity_id_Value eq 1>checked</cfif>>Ltd<br>
               <input type="radio" name="entity_id" value="2" <cfif entity_id_Value eq 2>checked</cfif>>Sole Trader<br>
               <input type="radio" name="entity_id" value="3" <cfif entity_id_Value eq 3>checked</cfif>>Partnership<br>
               <input type="radio" name="entity_id" value="4" <cfif entity_id_Value eq 4>checked</cfif>>Other<br></TD>
       </TR>

       <TR>
                       <TD class="contactadminsmall" valign="top" width="180" align="left"><nobr>Trading Name:</TD>
   <TD class="contactadminsmall" align="left" valign="top"><INPUT type="text" size="35" name="trading_name" value="#trading_name_Value#" maxLength="400" class="button"></TD>
       </TR>
       <!---<cfquery username="edebt" password="D7Oe+lus" name="Phone_prefix_X" dataSource="#request.dsn#">
               SELECT  *
               FROM    Phone_prefix
                       WHERE country_id =#COUNTRY_ID_value#
       </cfquery>--->
       <TR>
                       <TD class="contactadminsmall" valign="top" width="180" align="left"><nobr><span class="redtext">*</span>Phone: (no spaces)</TD>
   <TD class="contactadminsmall" align="left" valign="top">

<!---<select name="phone_prefix" class="button">
<cfloop query="Phone_prefix_X">
                       <option value="#Phone_prefix_X.prefix#" <cfif phone_prefix_value eq "#Phone_prefix_X.prefix#">SELECTED</cfif>>#Phone_prefix_X.prefix#</option>
</cfloop>--->

               </select><INPUT type="text" size="25" name="phone" value="#phone_Value#" maxLength="400" class="button"></TD>
       </TR>

       <TR>
                       <TD class="contactadminsmall" valign="top" width="180" align="left"><nobr>Mobile:</TD>
   <TD class="contactadminsmall" align="left" valign="top"><INPUT type="text" size="35" name="mobile" value="#mobile_Value#" maxLength="400" class="button"></TD>
       </TR>

       <TR>
                       <TD class="contactadminsmall" valign="top" width="180" align="left"><nobr>Email:</TD>
   <TD class="contactadminsmall" align="left" valign="top"><INPUT type="text" size="35" name="email" value="#email_Value#" maxLength="400" class="button"></TD>
       </TR>
       <TR>
                       <!---<TD class="contactadminsmall" valign="top" width="180" align="left"><nobr>Recoverable Costs:</TD>
   <TD class="contactadminsmall" align="left" valign="top"><input type="checkbox" name="recoverable_costs" value="1" <cfif recoverable_costs_Value_chk EQ 1 >checked</cfif>> (click to add)</TD>--->
       </TR>

       <TR>
                       <TD class="contactadminsmall" valign="top" width="180" align="left"><nobr><span class="redtext">*</span>Postal Address:</TD>
   <TD class="contactadminsmall" align="left" valign="top"><INPUT type="text" size="35" name="postal_address" value="#postal_address_Value#" maxLength="400" class="button"></TD>
       </TR>

       <TR>
                       <TD class="contactadminsmall" valign="top" width="180" align="left"><nobr><span class="redtext">*</span>Postal Suburb:</TD>
   <TD class="contactadminsmall" align="left" valign="top"><INPUT type="text" size="35" name="postal_suburb" value="#postal_suburb_Value#" maxLength="400" class="button"></TD>
       </TR>

       <TR>
                       <TD class="contactadminsmall" valign="top" width="180" align="left"><nobr><span class="redtext">*</span>Postal State:</TD>
   <TD class="contactadminsmall" align="left" valign="top"><INPUT type="text" size="35" name="postal_city" value="#postal_city_Value#" maxLength="400" class="button"></TD>
       </TR>

       <TR>
                                               <!--<TD class="contactadminsmall" valign="top" width="180" align="left"><nobr><span class="redtext">*</span>State:</TD>
                                  <td class="contactadminsmall"><INPUT type="text" size="35" name="State" value="#state_Value#"  class="button"><br></TD>-->
                               </TR>

       <TR>
                       <TD class="contactadminsmall" valign="top" width="180" align="left"><nobr><span class="redtext">*</span>Postcode:</TD>
   <TD class="contactadminsmall" align="left" valign="top"><INPUT type="text" size="35" name="postcode" value="#postcode_Value#" maxLength="400" class="button"></TD>
       </TR>

                                       <TR>
                                               <TD class="contactadminsmall" valign="top" width="180" align="left"><nobr><span class="redtext">*</span >Country:</TD>
                                          <td class="contactadminsmall">
                                                       <cfselect name="country_id" required="yes" message="You must select a country">
                                                               <cfloop query="GetCOUNTRY">
                                                               <cfscript>
                                                                       value_y = false;
                                                                       if(COUNTRY_ID_value  eq GetCOUNTRY.id){
                                                                       value_y = true;
                                                                       }
                                                                       if((COUNTRY_ID_value EQ 0 OR COUNTRY_ID_value EQ '') AND Trim(GetCOUNTRY.name) EQ "New Zealand"){
                                                                       value_y = true;
                                                                       }
                                                               </cfscript>
                                                                       <option value="#GetCOUNTRY.id#" <cfif value_y>SELECTED</cfif>>#GetCOUNTRY.name#</option>
                                                               </cfloop>
                                                       </cfselect>
                                               </TD>
                                       </TR>
       <input type="hidden" name="times_used" value="#times_used_Value#">

       <cfif session.business_type EQ 2>
               <cfquery username="edebt" password="D7Oe+lus" name="Get_biz" dataSource="#request.dsn#" dbtype="ODBC" >
                       Select *
                       From  Businesses
                               WHERE   business_type = 3
                               AND     head_office_id = #business_id_Value#
               </cfquery>
               <cfquery username="edebt" password="D7Oe+lus" name="Get_biz_root" dataSource="#request.dsn#" dbtype="ODBC" >
                       Select creditor
                       From  Businesses
                               WHERE Business_id = #business_id_Value#
               </cfquery>
          <tr>
                       <TD class="contactadminsmall" valign="top" width="180" align="left"><nobr><span class="redtext">*</span>Creditor:</td>
                       <td class="contactadminsmall" align="left" valign="top">
                               <select name="business_id" class="button">
                                       <option value="#business_id_Value#" Selected>#Get_biz_root.creditor#</option>
                                       <cfloop query="Get_biz">
                                               <option value="#business_id#">#creditor#</option>
                                       </cfloop>
                               </select>
                       </td>
               </tr>
       <cfelse>
               <input type="hidden" name="business_id" value="#business_id_Value#">
       </cfif>
       <TR>
               <TD colspan="2" valign="top">
               <INPUT type="submit" name="btnEdit_OK" value="    OK    " class="button">
           <CFIF ParameterExists(URL.debtor_id)>
                                       <cfquery name="z_checker" datasource="#request.dsn#" maxrows=1 dbtype="ODBC">
                                               SELECT *
                                               FROM  INVOICE_SETS
                                               WHERE INVOICE_SETS.debtor_id = #url.debtor_id#
                                       </cfquery>
                                       <cfif NOT  z_checker.recordcount GT 0>
                                               <input type="button" name="btnView_Delete" value="Delete" onclick="goDelete();" class="button">
                                       <cfelse>
                                               <input type="button" name="btnView_Delete" value="Delete" onclick="goDeleteFail();" class="button">
                                       </cfif>
               </cfif>
               <!--- <INPUT type="submit" name="btnEdit_Cancel" value="Cancel"> --->
               </TD>
       </tr>
</CFOUTPUT>
</cfFORM>
</TABLE>
-------------------------------------------------------------------------------------

    This topic has been closed for replies.

    2 replies

    Participant
    July 21, 2011

    Adam

    Thanks for your reply, there is also an action page, which you are refering to and this produced the error above previously posted:

    Sorry, should have posted this the 1st time.

    Also are going to a hosted environment which has CF8, and are not sure when they will upgrade to 9 or 10.

    However if I can run in 8, thats a great start!

    Thanks for your help

    <cftry>

    <cfdump var="#form#">

       <cfscript>

       Failure = 0;

       IF(IsDeFined("form.first_name")){

       IF(form.first_name EQ "" AND form.debtor_type EQ 0){

    writeoutput("<script> alert('Please enter information into first name and try again'); history.go(-1);</script>");

    failure = 1;

    }

    }

       IF(IsDeFined("form.last_name")){

       IF(form.last_name EQ "" AND form.debtor_type EQ 0){

    writeoutput("<script> alert('Please enter information into last name* and try again'); history.go(-1);</script>");

    failure = 1;

    }

    }

       IF(IsDeFined("form.phone")){

       IF(form.phone EQ "" OR NOT IsNumeric(form.phone)){

    writeoutput("<script> alert('Please enter information into phone* and try again'); history.go(-1);</script>");

    failure = 1;

    }

    }

       IF(IsDeFined("form.postal_address")){

       IF(form.postal_address EQ ""){

    writeoutput("<script> alert('Please enter information into Postal Address* and try again'); history.go(-1);</script>");

    failure = 1;

    }

    }

       IF(IsDeFined("form.postal_suburb")){

       IF(form.postal_suburb EQ ""){

    writeoutput("<script> alert('Please enter information into Postal Suburb* and try again'); history.go(-1);</script>");

    failure = 1;

    }

    }

       IF(IsDeFined("form.postal_city")){

       IF(form.postal_city EQ ""){

    writeoutput("<script> alert('Please enter information into Postal City* and try again'); history.go(-1);</script>");

    failure = 1;

    }

    }

       IF(IsDeFined("form.company_name") AND IsDeFined("form.debtor_type")){

       IF(form.company_name EQ "" AND form.debtor_type EQ 1){

    writeoutput("<script> alert('Please enter information into company name* and try again'); history.go(-1);</script>");

    failure = 1;

    }

    }

       </cfscript>

       <cfif Failure>

          <cfabort>

        </cfif>

    <CFSET  Form.last_modified=CreateODBCDateTime(ParseDateTime(now()))>

    <cfcatch type="Any">

    <script language="Javascript">

    alert('You have entered an incorrect date, please check your data.')

    history.back()

    </script>

    <cfabort>

    </cfcatch>

    </cftry>

    <CFIF ParameterExists(url.delete)>

    <cftry>

    <cfquery name="z_checker" datasource="#request.dsn#" maxrows=1 dbtype="ODBC">

    SELECT *

    FROM  INVOICE_SETS

    WHERE INVOICE_SETS.debtor_id = #form.debtor_id#

    </cfquery>

    <cfif z_checker.recordcount GT 0>

    <script language="Javascript">

    alert('I\'m sorry I cannot allow you to delete this debtor because there are invoice sets loaded against him / her ')

    history.back()

    </script>

    <cfabort>

    </cfif>

    <cfquery username="edebt" password="D7Oe+lus" name="DeleteRecord" dataSource="#request.dsn#" maxRows=1>

    DELETE

    FROM DEBTORS

    WHERE DEBTORS.debtor_id = #FORM.debtor_id#

    </CFQUERY>

    <cfcatch type="Any">

    <script language="Javascript">

    alert('I\'m sorry I cannot allow you to delete this debtor due to related information.')

    history.back()

    </script>

    <cfabort>

    </cfcatch>

    </cftry>

    <!------>

    <CFLOCATION url="index.cfm?fuseaction=DEBTORS_RecordView">

    <CFELSEIF ParameterExists(Form.btnEdit_OK)>

    <CFIF ParameterExists(Form.debtor_id)>

    <CFUPDATE dataSource="#request.dsn#" tableName="DEBTORS" formFields="#form.fieldList#">

    <cfif IsDefined("form.recoverable_costs")>

    <cfquery username="edebt" password="D7Oe+lus" name="GetRecord" datasource="#request.dsn#" maxrows=1 dbtype="ODBC">

    update DEBTORS

    Set recoverable_costs = 1

    where DEBTORS.debtor_id = #Form.debtor_id#

    </cfquery>

    <CFLOCATION url="index.cfm?fuseaction=DEBTORS_RecordView">

    <cfelse>

    <cfquery username="edebt" password="D7Oe+lus" name="GetRecord" datasource="#request.dsn#" maxrows=1 dbtype="ODBC">

    update DEBTORS

    Set recoverable_costs = 0

    where DEBTORS.debtor_id = #Form.debtor_id#

    </cfquery>

    <CFLOCATION url="index.cfm?fuseaction=DEBTORS_RecordView">

    </cfif>

    <CFELSE>

    <cfif IsNumeric(form.dob_Year) AND IsNumeric(form.dob_Month) AND IsNumeric(form.dob_Day)>

            <cfset date_of_birth = CreateDate(form.dob_Year,form.dob_Month,form.dob_Day)>

            <cfset date_of_birth_ok = "some_value">

         </cfif>

    <cftry>

    <!---<cfscript>

    if (NOT IsDefined("form.data_checked")){

    form.fieldlist = ListAppend(form.fieldlist, "data_checked",",");

    form.data_checked = 0;

    } else writeoutput("defined");

    </cfscript>--->

            <cfscript>

    if (NOT IsDefined("form.data_checked")){

    form.fieldlist = ListAppend(form.fieldnames, "data_checked",",");

    form.data_checked = 0;

    } else writeoutput("defined");

    </cfscript>

    <!---<CFINSERT dataSource="#request.dsn#" tableName="DEBTORS" formFields="#Form.FieldList#">--->

            <CFINSERT dataSource="#request.dsn#" tableName="DEBTORS" formFields="#Form.Fieldnames#">

    <cfcatch><cfoutput>#cfcatch.message##cfcatch.detail##form.fieldnames#</cfoutput><!---

                                               <cfloop from="1" to=#listlen(form.fieldnames)# index="lk">

                                                     <cfoutput>= #lk#<br></cfoutput>

    </cfloop>--->

    <cfabort>

    </cfcatch>

    </cftry>

    <cfquery username="edebt" password="D7Oe+lus" name="get_new_id" datasource="#request.dsn#" maxrows=1 dbtype="ODBC">

    select Max(debtor_id) As The_new

    from DEBTORS

    </cfquery>

    <cfif IsDefined("date_of_birth_ok")>

    <cfquery username="edebt" password="D7Oe+lus" name="get_new_id" datasource="#request.dsn#" dbtype="ODBC">

    update DEBTORS

    set date_created = #now()#,

        date_of_birth= #createODBCdate(date_of_birth)#

    where debtor_id = #get_new_id.The_new#

    </cfquery>

    </cfif>

    <CFLOCATION url="index.cfm?fuseaction=DEBTORS_RecordView" addtoken="No">

    </CFIF>

    <CFELSEIF ParameterExists(Form.btnEdit_Cancel)>

    <CFLOCATION url="index.cfm?fuseaction=DEBTORS_RecordView" addtoken="No">

    </CFIF>

    Inspiring
    July 21, 2011

    Can you pls re-read the first para of my previous post.

    --

    Adam

    Inspiring
    July 21, 2011

    OK, the error message will also tell you exactly what line is causing the error, including the specific chunk of code at that point.  It will also be outputting the SQL statement it's trying to execute which is causing the problem.  That's the stuff we're interested in.  Not all the HTML and other bumpf within two miles of it.

    It looks to me like somewhere else you have a CFINSERT or CFUPDATE statement which does not specify the formfields the tag should be using, so it's trying to use all of them, and you've got a form field called "fieldList" (which you do) which is not in that table.  But that's not in the code you posted.

    Question: why are you only upgrading to CF8, when CF9 has been out for over a year, and CF10 is on the way?  CF8 will be going into "restricted support" in the next year or so.

    Observations:

    * you probably want to get rid of your parameterExists() calls in favour of structKeyExists().

    * you used # signs an awful lot where you don't need to.

    * you should be parameterising your dynamic values in your CFQUERY tags rather than hard-coding them in your SQL statements

    * SELECT * is almost always returning more DB columns than one needs.

    * get rid of the DBTYPE attributes in your CFQUERY tags.  Versions of CF after CF5 do not use ODBC, they use JDBC.  The only valid value for that attribute in CF8 is "query", but that's only valid when doing QoQ.

    Obviously do your CF upgrade done first, before changing any code unnecessarily though.

    --

    Adam