Hi All,
I need help to achieve something. I have a payments/accounts system where the user selects a payment with an ID and then clicks on various accounts to allocate the funds. As they click each one, a field in accounts called temp_payment_ID gets filled with the related payment ID and several other fields like temp_balance and temp_payment get filled with data specific to the transaction. All labeled temp to give me a rollback ability if they cancel.
If the user commits this transaction, I then want to update all the ‘real’ fields with the temp fields using a relation of PaymentID - temp_Payment_ID which I can set up no problems.
My problem is, how do I ‘cycle’ through these related records and replace the contents of the row field (e.g.new_actual_balance) with the row field temp_balance??? I obviously need to know this for the reversal or rollback that I mentioned above.
I have seen other posts using getFounbdSetUpdater but can I use this row per row saying ‘Update field1 with the contants of field2’ so each row gets updated individually?
Hope I have explained this problem well enough…
I was thinking this might work - anyone got any advice???
controller.setSelectedIndex(1)
var fsUpdater = databaseManager.getFoundSetUpdater(temp_pay_id_to_accounts)
while(fsUpdater.next())
{
fsUpdater.setColumn(‘balance’,‘temp_balance’);
fsUpdater.setColumn(‘payment_id’,‘temp_payment_id’);
}
OR - will I need to assign variables with the contents of the row field that I want to transpose to another field like this???
controller.setSelectedIndex(1)
var fsUpdater = databaseManager.getFoundSetUpdater(temp_pay_id_to_accounts)
while(fsUpdater.next())
{
var new_value_for_balance = temp_pay_id_to_accounts.temp_balance
var new_value_for_payment_id = temp_pay_id_to_accounts.tem_payment_id
fsUpdater.setColumn(‘balance’,‘temp_balance’);
fsUpdater.setColumn(‘payment_id’,‘temp_payment_id’);
}
what is stored in those tables?
is the temp_balance and temp_payment_id for every row the same?
then you need to query for the values of temp_balance and temp_payment_id then you need to do this:
var temp_balance = 10; << youre queried value
var temp_paymanent_id = 9; << youre queried value
controller.setSelectedIndex(1)
var fsUpdater = databaseManager.getFoundSetUpdater(temp_pay_id_to_accounts)
while(fsUpdater.next())
{
fsUpdater.setColumn(‘balance’,temp_balance);
fsUpdater.setColumn(‘payment_id’,temp_payment_id);
}
(notice that it is without the qoutes)
you can’t say column = column currently.