Hello,
I am new to Baan/Infor Programming and extensibility. I am trying to delete a record in the tfgld018 after deleting a record from tfacp200.
After deleting the record from tfacp200 the UI shows a message reporting: "Record not present in Documents for company", so the record is not deleted from tfgld018.
I tried to use db.update and using it the record is correctly updated. What am i missing?
This is the script in the after.destroy hook:
|delete the record from documents, does not work
select tfgld018.*
from tfgld018 for update
where tfgld018._index1 = {:tfacp200.ttyp, :tfacp200.ninv}
as set with 1 rows
selectdo
db.delete(ttfgld018, db.retry)
endselect
| update the document after the delete, this works
select tfgld017.*
from tfgld017 for update
where tfgld017._index1 = {:tfacp200.ttyp,:tfacp200.year}
selectdo
tfgld017.docn = tfgld017.docn - 1
|