Please some help.
I have a Master Detail Form
Master File Name -> customers
Detail File Name -> cptecli
From the master file I have 1 field to update with data from the detail file
The field name in the master file to update is -> BalanceCpteGdes
the following fields are found in the detai file -> journalID, CustID, INV_NO, DEBIT, CREDIT, BALANCE
in the deail file once open, either the DEBIT OR THE CREDIT FIELD is captured from the keyboard by the user
I setup the following METHOD -> update_cpte() // call from AfterUpdate
sc_lookup(dataset,“SELECT
BalanceCpteGdes
FROM customer
WHERE CustID = {CustID}”);
$actualbalance = number_format({dataset[0][0]}, 2, ‘.’, ‘,’);
$newBalanceGde = $actualbalance + {DEBIT} - {CREDIT};
{BALANCE} = $newBalanceGde;
sc_lookup(dataset,“SELECT
SUM(DEBIT), SUM(CREDIT)
FROM cptecli
WHERE CustID = {CustID}”);
$totdebit = number_format({dataset[0][0]}, 2, ‘.’, ‘,’);
$totcredit = number_format({dataset[0][1]}, 2, ‘.’, ‘,’);
sc_master_value(‘BalanceCpteGdes’, BalanceCpteGdes + $totdebit - $totcredit);
It does not work - the field in the master is not being updated
nor are the BALANCE field in the detail file.
Is this type of coding Ok for what I need to do?
Please advise