Reputation: 681
Essentially, what I'm doing is this:
I have code that is doing what is described above -- but with the following side-effect:
What would be the best way to erase the added-by-code discounts or charges when the parent line is deleted, that won't cause the form to blow up if a user selects those same lines for deletion?
Thanks in advance, this thing is driving me crazy!
EDIT: The specific error that I receive when the cached Form records try to get deleted is this:
Cannot edit a record in Order lines (SalesLine).An update conflict occurred due to another user process deleting the record or changing one or more fields in the record.
Upvotes: 0
Views: 1946
Reputation: 18051
The most obvious way to delete the added-by-code
discounts or charges would be to add your table in the delete actions of the salesLine
table with option Cascade
. Also make a table relation on your table to the SalesLine
talbe. In this way your records are deleted automatically. I would not do this if the discounts/charges are stored as sales lines though.
The error message make me guess, that you delete other sales lines, when deleting a sales line:
Update for the delete problem:
SalesLine
delete methods.salesLine
datasource delete method.Upvotes: 1