Roger Blanchard
447 posts
Registered:
29 Jun 2018
03 Apr 2019
Link to this post
We have a BE with many tables. We use this for our point of sale transaction processing logic where we are parsing our electronic journal ("EJ") and creating records in TT's. When we are done parsing the "EJ" we then want to update the DB from the TT. In our existing POS module we scope the DB update as one DB transaction. We either want all the tables to be updated or none.
How would we go about doing this with our Dataset Model class?
I have tried
/* Roger Blanchard / Osprey Retail Systems Apr 2, 2019
Enable tracking changes
*/
oGeneralTotal:TrackingChanges = TRUE.
// find an update record
oGeneralTotal:NewFilter(oTransactionTotals:PostingDate,
"D",
oTransactionTotals:CashierNum,
"").
oGeneralTotal:TrackingChanges = TRUE.
IF NOT oGeneralTotal:GeneralTotal:Available THEN
DO:
oGeneralTotal:GeneralTotal:Create().
oGeneralTotal:GeneralTotal:SaleDate = oTransactionTotals:PostingDate.
oGeneralTotal:GeneralTotal:Period = "D".
oGeneralTotal:GeneralTotal:CashierNum = oTransactionTotals:CashierNum.
oGeneralTotal:GeneralTotal:RegNum = "".
END.
// Update addl fields here
// find an update another record here which may or may not be the same table
// when we fetch the tracking changes will be turned off by default.
// how do we save the changes from above in the TT and then send the entire batch of changes
/ to the backend
// now savechanges
oGeneralTotal:SaveChanges().