This one is killing me!!
I am trying to use the ListContains and ListGetAt functions to update a list that has been passed from an array. I am using the default delimiter (comma). The values are passing to the action page as numerics such as .00, .00, l25.29, etc. I first look to see if the record has been "bypassed", if so, the value is 0. Otherwise, update based on current input. However, the update fails with the following error.
Error Diagnostic Information
An error occurred while evaluating the expression:
ListContains(BypassMthCheck, LoopCounter, ","
IS 0
Error near line 19, column 53.
Error resolving parameter LOOPCOUNTER
ColdFusion was unable to determine the value of the parameter. This problem is very likely due to the fact that either:
1. You have misspelled the parameter name, or
2. You have not specified a QUERY attribute for a CFOUTPUT, CFMAIL, or CFTABLE tag.
The error occurred while processing an element with a general identifier of (CFIF), occupying document position (19:1) to (19:58) in the template file D:\Inetpub\ development\docs\inside_tg\planning\pgm\UpdatePerf.cfm.
My code is attached.
<CFIF ListContains(BypassMthCheck, LoopCounter, ","
IS 0>
<CFSET ignore_month = "N">
<CFSET msur_actl_perf_amt = #ListGetAt(actl_perf_amt, LoopCounter)#>
<CFELSE>
<CFSET ignore_month = "Y">
<CFSET msur_actl_perf_amt = 0>
</CFIF>
<CFLOOP Index="LoopCounter"
From ="1" To="#FormrecCount#">
<CFQUERY NAME="GetPerf" DATASOURCE="PGM">
SELECT *
FROM Performance
WHERE Performance.dlvr_id = #ListGetAt(dlvr_id, LoopCounter)#
AND Performance.msur_id = #ListGetAt(msur_id, LoopCounter)#
AND Performance.perf_date = #ODBCSelectedDate#
</CFQUERY>
<CFTRANSACTION>
<CFIF #GetPerf.RecordCount# IS 0>
<CFQUERY NAME="InsertPerf" DATASOURCE="PGM">
INSERT INTO Performance(perf_date, actl_perf_amt, dlvr_id, msur_id, ignore_month)
VALUES (#ODBCSelectedDate#, #msur_actl_perf_amt#, #ListGetAt(dlvr_id, LoopCounter)#, #ListGetAt(msur_id, LoopCounter)#, '#ignore_month#')
</CFQUERY>
<CFELSE>
<CFQUERY NAME="UpdtPerf" DATASOURCE="PGM">
UPDATE Performance
SET actl_perf_amt = #msur_actl_perf_amt#,
ignore_month = '#ignore_month#'
WHERE dlvr_id = #ListGetAt(dlvr_id, LoopCounter)#
AND msur_id = #ListGetAt(msur_id, LoopCounter)#
AND perf_date = '#ListGetAt(perf_date, LoopCounter)#'
</CFQUERY>
</CFIF>
<CFSET Vmsur_freq = #msur_freq#>
<CFSET mth_pog = 0>
<CFSET ytd_pog = 0>
<CFSET ytd_perf = 0>
<CFINCLUDE TEMPLATE="CalcPGM.cfm">
<CFQUERY NAME="UpdtPerf" DATASOURCE="PGM">
UPDATE Performance
SET mth_pog = #ListGetAt(mth_pog, LoopCounter)#,
ytd_perf = #ListGetAt(ytd_perf, LoopCounter)#,
ytd_pog = #ListGetAt(ytd_pog, LoopCounter)#
WHERE dlvr_id = #ListGetAt(dlvr_id, LoopCounter)#
AND msur_id = #ListGetAt(msur_id, LoopCounter)#
AND perf_date = #ODBCSelectedDate#
</CFQUERY>
</CFTRANSACTION>
</CFLOOP>
<CFINCLUDE TEMPLATE="UpdateDetail.cfm">
Thanks for any help.
I am trying to use the ListContains and ListGetAt functions to update a list that has been passed from an array. I am using the default delimiter (comma). The values are passing to the action page as numerics such as .00, .00, l25.29, etc. I first look to see if the record has been "bypassed", if so, the value is 0. Otherwise, update based on current input. However, the update fails with the following error.
Error Diagnostic Information
An error occurred while evaluating the expression:
ListContains(BypassMthCheck, LoopCounter, ","

Error near line 19, column 53.
Error resolving parameter LOOPCOUNTER
ColdFusion was unable to determine the value of the parameter. This problem is very likely due to the fact that either:
1. You have misspelled the parameter name, or
2. You have not specified a QUERY attribute for a CFOUTPUT, CFMAIL, or CFTABLE tag.
The error occurred while processing an element with a general identifier of (CFIF), occupying document position (19:1) to (19:58) in the template file D:\Inetpub\ development\docs\inside_tg\planning\pgm\UpdatePerf.cfm.
My code is attached.
<CFIF ListContains(BypassMthCheck, LoopCounter, ","

<CFSET ignore_month = "N">
<CFSET msur_actl_perf_amt = #ListGetAt(actl_perf_amt, LoopCounter)#>
<CFELSE>
<CFSET ignore_month = "Y">
<CFSET msur_actl_perf_amt = 0>
</CFIF>
<CFLOOP Index="LoopCounter"
From ="1" To="#FormrecCount#">
<CFQUERY NAME="GetPerf" DATASOURCE="PGM">
SELECT *
FROM Performance
WHERE Performance.dlvr_id = #ListGetAt(dlvr_id, LoopCounter)#
AND Performance.msur_id = #ListGetAt(msur_id, LoopCounter)#
AND Performance.perf_date = #ODBCSelectedDate#
</CFQUERY>
<CFTRANSACTION>
<CFIF #GetPerf.RecordCount# IS 0>
<CFQUERY NAME="InsertPerf" DATASOURCE="PGM">
INSERT INTO Performance(perf_date, actl_perf_amt, dlvr_id, msur_id, ignore_month)
VALUES (#ODBCSelectedDate#, #msur_actl_perf_amt#, #ListGetAt(dlvr_id, LoopCounter)#, #ListGetAt(msur_id, LoopCounter)#, '#ignore_month#')
</CFQUERY>
<CFELSE>
<CFQUERY NAME="UpdtPerf" DATASOURCE="PGM">
UPDATE Performance
SET actl_perf_amt = #msur_actl_perf_amt#,
ignore_month = '#ignore_month#'
WHERE dlvr_id = #ListGetAt(dlvr_id, LoopCounter)#
AND msur_id = #ListGetAt(msur_id, LoopCounter)#
AND perf_date = '#ListGetAt(perf_date, LoopCounter)#'
</CFQUERY>
</CFIF>
<CFSET Vmsur_freq = #msur_freq#>
<CFSET mth_pog = 0>
<CFSET ytd_pog = 0>
<CFSET ytd_perf = 0>
<CFINCLUDE TEMPLATE="CalcPGM.cfm">
<CFQUERY NAME="UpdtPerf" DATASOURCE="PGM">
UPDATE Performance
SET mth_pog = #ListGetAt(mth_pog, LoopCounter)#,
ytd_perf = #ListGetAt(ytd_perf, LoopCounter)#,
ytd_pog = #ListGetAt(ytd_pog, LoopCounter)#
WHERE dlvr_id = #ListGetAt(dlvr_id, LoopCounter)#
AND msur_id = #ListGetAt(msur_id, LoopCounter)#
AND perf_date = #ODBCSelectedDate#
</CFQUERY>
</CFTRANSACTION>
</CFLOOP>
<CFINCLUDE TEMPLATE="UpdateDetail.cfm">
Thanks for any help.