Hello Everybody
I'm getting a very strange situation.
I'm working to migrate a Cold Fusion site from v8 to v10. Into new v10 environment I'm getting an error that is not present into v8 version. The code is the same.
Basically, I have a <cfform> with a dinamic number of <cfinput>. These <cfinput> are generating looping a <CFQUERY>.
In total I have 42 rows.
If I force the limit of the rows to 32, the form is correctly submitted to an "action" destination file that is inserting data into a database.
If I force the limit of the rows to 33, I get an error 500 - "The page you are trying to access can not be displayed. Please try again or notify the administrator". The issue is not related to data, I have already checked for it.
Everytimes the application should update into database ALL rows present on the form.
===============================
THIS IS THE FILE WITH CFFORM
===============================
<CFSET HttpName = "http:" & #Application.RootDir#>
<cfinclude template="..#application.mapping#/includes/algVerifySession.cfm">
<!DOCTYPE html public "-//W3C//DTD HTML 4.0 Transitional//EN"><!-- saved from url=(0036)http://www.elanco.com/meet/meet.html -->
<HTML>
<HEAD>
<TITLE>Average Prices</TITLE>
<CFQUERY name="Get_average_val" datasource="#application.datasource#" username="#application.username#" password="#application.password#">
SELECT A.PROFCENT,
A.VAL,
SUBSTR(B.DESPRO, 1, 21) AS DESPRO
FROM PREZZI_MEDI A, PROFCENTER B
WHERE A.PROFCENT = B.PROFCENT
</CFQUERY>
<META content="text/html; charset=windows-1252" http-equiv="Content-Type">
<CFOUTPUT>
<!---MIGRAZIONE ELANCO A CF10--->
<!---<SCRIPT language=Javascript src="#httpname#includes/navscript.js"></SCRIPT>--->
<SCRIPT language=Javascript src="../includes/navscript.js"></SCRIPT>
<!---MIGRAZIONE ELANCO A CF10--->
</CFOUTPUT>
<CFOUTPUT>
<link rel="stylesheet" href= "../includes/newstyle.css" type="text/css">
<SCRIPT type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.js"></SCRIPT>
<SCRIPT type="text/javascript" src="../includes/jquery.paginatetable.js"></SCRIPT>
</CFOUTPUT>
<META content="MSHTML 5.00.2614.3401" name="GENERATOR">
<SCRIPT language="Javascript">function OpenInsert()
{
appo_width = 350;
appo_height = 230;
/* if (w == null) */
var w = window.open("insert.cfm", "DisplayWindow", "Toolbar=No, height=" + appo_height + ", width=" + appo_width + ", resizable=yes");
/* else
null;
if (w.closed == false)
w.close();
w = window.open("insert.cfm", "DisplayWindow", "Toolbar=No, height=" + appo_height + ", width=" + appo_width + ", resizable=yes"); */
return;
}
</SCRIPT>
</HEAD>
<BODY>
<div class="toolbar">
<div class="tool_title"><h1>Plan Management » <span>Average Prices Management Tool</span></h1></div>
<div class="tool_button">
<a href="javascript: void(0);" onClick="OpenInsert();" class="btn_big_new">Insert</a>
</div>
<div class="wrap"></div>
</div>
<CFIF Isdefined("url.ret") and url.ret NEQ "OK">
<DIV class="Error">Error! Saving failed.</DIV>
</CFIF>
<div class="toolbar">
<div class="tool_button">
<table>
<tr>
<td><a class="button" href="xlsDefault.cfm" >Open Excel</a></td>
</tr>
</table>
</div>
</div>
<div id="main">
<CFFORM name="update" action="update.cfm?type=update&number=#Get_average_val.RecordCount#" method="post">
<TABLE id="listvalue" class="tbl_contenuti">
<TR>
<th>Profit Center</th>
<th>Description</th>
<th>Average</th>
</TR>
<tbody>
<CFSET ind = 0>
<CFOUTPUT query="Get_average_val">
<CFSET ind = ind + 1>
<CFSET val_name = "VAL_" & ind>
<CFSET val_name_hid = "VAL_HID_" & ind>
<CFSET GRP_name_hid = "GRP_HID_" & ind>
<TR class="body_rows">
<TD>#PROFCENT#</TD>
<TD >#DESPRO#</TD>
<TD align="right">
<cfif session.ruolo eq "A">
<CFINPUT type="text" name="#val_name#" class="TextLeft" size="14" maxlength="10" value="#VAL#" message="Non hai inserito un valore numerico!" validate="float" >
<cfelse>
#VAL#
</cfif>
<INPUT name="#val_name_hid#" value="#VAL#" type="hidden">
<INPUT name="#GRP_name_hid#" value="#PROFCENT#" type="hidden">
</TD>
</TR>
</CFOUTPUT>
</tbody>
<TR>
<CFOUTPUT>
<TD align="center" colspan="3">
<cfif session.ruolo eq "A">
<a href="javascript:document.update.submit();" class="button">Update</a>
<!---<cfinput type="Submit" name="SubmitForm" value="Submit">--->
</cfif>
</TD>
</CFOUTPUT>
</TR>
</TABLE>
</CFFORM>
<div class='pager'>
<a href='#' alt='Previous' class='prevPage'>Prev</a>
<span class='pageNumbers'></span>
<span class='currentPage'></span> of <span class='totalPages'></span>
<a href='#' alt='Next' class='nextPage'>Next</a>
</div>
<script>
$(document).ready(function () {
$('#listvalue').paginateTable({ rowsPerPage: 10 });
});
</script>
</div>
</BODY>
</HTML>
=================================
THIS IS THE FILE THAT IS EXECUTING THE UPDATE (THE ACTION OF THE FORM)
=================================
!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
</head>
</html>
<cfset ret = "OK">
<cfif type EQ "update">
<cfloop index="ind" from="1" to="#url.number#">
<cfset appo_val = Evaluate("val_" & ind)>
<cfif appo_val NEQ Evaluate("val_hid_" & ind)>
<cfset appo_grp = Evaluate("GRP_HID_" & ind)>
<cftransaction action="BEGIN">
<cftry>
<cfquery name="UpdateAverage" datasource="#application.datasource#" username="#application.username#" password="#application.password#">
UPDATE PREZZI_MEDI
SET VAL = #appo_val#
WHERE PROFCENT = '#appo_grp#'
</cfquery>
<cfcatch type="database">
<cfset ret = "NO">
</cfcatch>
</cftry>
<CFIF ret EQ "OK">
<CFTRANSACTION ACTION="COMMIT">
<cfelse>
<CFTRANSACTION ACTION="ROLLBACK">
</cfif>
</cftransaction>
</cfif>
</cfloop>
<cfoutput>
<cflocation url="default.cfm?ret=#ret#">
</cfoutput>
</cfif>
Many Thanks for your help on that.
Best Regards.
M.R.