A small difficulty here. Table A keeps track of donations & table stores details for these donations. A single donation may have more than one detail. When detail is being created, the amount of the donations is stored in a global variable(global.donation_amount). Another global variable(global.don_detail_amt) is also created with a default value of "0". On the detail form, when tabbing into the detail_amount field a onFocuseGained method is triggered, putting the default value (global.donation_amount) in it.
- Code: Select all
function set_Detail_Amount() {
if(globals.don_detail_total_amt < 1){
detail_amount = globals.don_amount;
}
else if(globals.don_detail_total_amt > 0 && globals.don_detail_total_amt < globals.don_amount){
detail_amount = globals.don_amount - globals.don_detail_total_amt;
}
elements.fld_amount.selectAll();
}
The data in the detail_amount field is then changed (if necessary). When tabbing out of the detail_amount field a onFocusLost method is triggered, displaying the appropriate button.
- Code: Select all
function set_Buttons() {
globals.don_detail_total_amt = (globals.don_detail_total_amt + detail_amount);
if(globals.don_detail_total_amt != globals.don_amount){
elements.btn_do_another_detail.visible = true;
elements.lbl_do_another_detail.visible = true;
}
else{
elements.btn_done_with_detail.visible = true;
elements.lbl_done_with_detail.visible = true;
}
application.updateUI();
}
This works fine in 3.5.x but in 5.2, although the value in the detail_amount field can be changed, the value that the method sees never changes, ie: if the onFocuseGained method puts a value of 300, and the user changes it to 100, the form shows 100 but the method only sees 300. I observed this by watching the variables in the debug mode.
If I remove the onFocuseGained method then the onFocusLost method works properly. but this removes the important error checking portion of the onFocuseGained method.
I know this is wordy but i don't know how else to explain it. Thanks for your assistance.