I have a dialog to record a deposit. The user will put in the total deposit amount and then in the repeating section there are rows to post specific amounts to individual accounts. I am trying to validate that the amounts in each row equals the total deposit amount. I am getting an error even I am following the sample code in the "dialogValidate" event on Server Side events....
This is the code
'Example for a field in a repeating section
'dim i as n
'dim count as n
'count = e.dataSubmitted.qty.size()
''Loop over each entry in the array of data that was submitted
'for i = 1 to count
' if convert_type(e.dataSubmitted.qty[i],"N") > 10 then
' dialogValidate.hasError = .t.
' dialogValidate.errorText = dialogValidate.errorText + "Quantity in row " + i + "must be less than 10 <br>"
' end if
'next i
dim depttl as n
depttl = convert_type(e.DataSubmitted.DepositAmt,"N")
dim rowsttl as n
dim i as n
dim count as n
count = e.dataSubmitted.amount.size()
'Loop over each entry in the array of data that was submitted
for i = 1 to count
rowsttl = rowsttl + convert_type(e.dataSubmitted.Amount[i],"N")
next i +
if depttl <> rowsttl then
dialogValidate.hasError = .t.
dialogValidate.errorText = "Deposit Amount does not equal row total. <br>"
end if
I am getting an error in the line where I am assigning the variable "count'. If I assign a value to 'count' such as the number 1, then I get the same error in 'rowsttl line saying that Property not found e.dataSubmittted.amount subelement no found.
Can someone offer some advice? I followed the sample but I don't understand why the error.
Here is a screen shot of the input box.
deposit.jpg
Thanks for your thoughts.
This is the code
'Example for a field in a repeating section
'dim i as n
'dim count as n
'count = e.dataSubmitted.qty.size()
''Loop over each entry in the array of data that was submitted
'for i = 1 to count
' if convert_type(e.dataSubmitted.qty[i],"N") > 10 then
' dialogValidate.hasError = .t.
' dialogValidate.errorText = dialogValidate.errorText + "Quantity in row " + i + "must be less than 10 <br>"
' end if
'next i
dim depttl as n
depttl = convert_type(e.DataSubmitted.DepositAmt,"N")
dim rowsttl as n
dim i as n
dim count as n
count = e.dataSubmitted.amount.size()
'Loop over each entry in the array of data that was submitted
for i = 1 to count
rowsttl = rowsttl + convert_type(e.dataSubmitted.Amount[i],"N")
next i +
if depttl <> rowsttl then
dialogValidate.hasError = .t.
dialogValidate.errorText = "Deposit Amount does not equal row total. <br>"
end if
I am getting an error in the line where I am assigning the variable "count'. If I assign a value to 'count' such as the number 1, then I get the same error in 'rowsttl line saying that Property not found e.dataSubmittted.amount subelement no found.
Can someone offer some advice? I followed the sample but I don't understand why the error.
Here is a screen shot of the input box.
deposit.jpg
Thanks for your thoughts.
Comment