We just discovered something about the way XBasic (in particular the AfterDialogValidate server side function) handles repeating section data.
We are currently trying to construct a SOAP call based on submitted data. One of the sections in the SOAP call contains a repeating section of fields, so we match it with a repeating section on our form. We loop through by using something similar to the following code:
Etc etc. That's just a very slim example of the code we are using, but it describes the issue.
Our issue is, apparently in the way XBasic handles the e.dataSubmitted for repeating section rows, it takes the physical row number, and therefore takes deleted rows into account.
For example: Say we have a repeating section with 4 rows, and we delete the 3rd row, so now only 3 rows remain. e.dataSubmitted.field.size() will be 4, and e.dataSubmitted.field[3] will contain the value of the field in the 3rd repeating section row that was deleted, and not the 4th row that became the 3rd row.
I need to know if there's a simple way to make this loop only get data from the Logical rows, not the physical ones. I don't care about deleted rows, since they are deleted, and obviously I won't be using them.
Thanks.
We are currently trying to construct a SOAP call based on submitted data. One of the sections in the SOAP call contains a repeating section of fields, so we match it with a repeating section on our form. We loop through by using something similar to the following code:
Code:
FOR i = 1 TO e.dataSubmitted.field.size() xmlVar = xmlVar + <<%xml% <xmlField>{e.dataSubmitted.field[i]}</xmlField> %xml% NEXT xmlVar = evaluate_string(xmlVar)
Our issue is, apparently in the way XBasic handles the e.dataSubmitted for repeating section rows, it takes the physical row number, and therefore takes deleted rows into account.
For example: Say we have a repeating section with 4 rows, and we delete the 3rd row, so now only 3 rows remain. e.dataSubmitted.field.size() will be 4, and e.dataSubmitted.field[3] will contain the value of the field in the 3rd repeating section row that was deleted, and not the 4th row that became the 3rd row.
I need to know if there's a simple way to make this loop only get data from the Logical rows, not the physical ones. I don't care about deleted rows, since they are deleted, and obviously I won't be using them.
Thanks.
Comment