I guess this is a two part question. I have a list view form that shows fields from a relationship that can be edited. Those fields are contained in the form body and I have assigned them a tab sequence. I also have a header and a footer that display a mixture of fields, labels, and form variables that cannot be edited nor are they contained in the tab sequence. I have an onDataChange method attached to the 5th field in the body of the form (also the 5th in the tab sequence) that updates a value in a form variable contained in the footer. As I tab through my fields, when I hit the 5th field and enter a value and then tab out, my tab sequence appears to get lost and starts tabbing through labels, fields, and form variables that aren’t in the sequence. Also, my form variable I am trying to update doesn’t change.
Here is the method I call:
function paid_onDataChange()
{
//Update Batch Remaing
var fs = forms.Ledger_Payments_Detail.foundset;
var fsCount = fs.getSize();
var curIndex = fs.getSelectedIndex();
var curPaid;
var totalPaid = 0;
//Loop through the records in the foundset and add the paid amounts together
for(var i = 1; i <= fsCount; i++)
{
fs.setSelectedIndex(i)
curPaid = fs.getSelectedRecord().ledger_charges_to_charge_transactions.paid;
totalPaid = totalPaid + curPaid;
}
fs.setSelectedIndex(curIndex);
frm_batchRemaining = frm_batchAmount - totalPaid;
}
Why does the onDataChange method cause the sequence to lose sync? When I debug this method, the form variable frm_batchRemaining appears correct, but doesn’t show the correct value in the smart client. Could the tab sequence getting out of sync also cause my form variable to not update?
Thanks,
Nicholas