The second insert should not ever fail, IF I have validated the data correctly prior to insert. I experienced a failure during development/testing. So I asked what I thought to be a simple question. Turns out it's not so simple.
While the two records created are "complimentary", there is no real connection between the two... they are really "offsetting" so that the change in Qty on Hand for that Company/Warehouse/Part nets to zero. There are two "header" or parent files that ensure these stay in sync. (They can get out of sync during abnormal ends to other ERP applications). There is a resolution program that runs.
IC Balance - Qty on Hand for a Company/Warehouse/Part (header)
IC Detail - Qty on Hand for a Company/Warehouse/Part/Location (detail)
IC Location Transaction Details (the file I'm working with) - transactions by Company/Warehouse/Part/Location
So when something creates IC Location Transaction Details, the background programs in the ERP update the corresponding (parent) IC Balance & Detail files.
Records are never deleted from this file - only created.
So I think I'm OK w/out a solution. Although I may try the journaling option mentioned by Charles.
As an Amazon Associate we earn from qualifying purchases.
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.