problem when deleting records on form-init

hi, i’ve got a nice problem. i have a form with a subform and in the OnAfterGetCurrRecord() trigger if make some SETRANGEs on different records so i can show the values of these records additionally to the values which comes from the source table. i want to write an error message when their isn’t a record found. but when i try to delete / write (it must be cleared when the form opens) in my error-table out of this trigger navision says that i can’t change database out of this code … any idea ?


but when i try to delete / write (it must be cleared when the form opens)

Hi Alex! What are you deleting or writing? Manually? By code? What has to be cleared? Regards, Jörg

You cannot delete/insert records (no matter the table you try on) on the event onaftergetrecord

mmhm this is sad … but how to solve this problem: the form opens … the linked subform in the form filters its records … every record calls a code in its OnGetRecord which gives the record additional info out of other tables (i don’t wanne use flowfields with lookup-method!) … i want to write in a table or a file if an information couldn’t be found … mmmh … any idea ?

Hmmmm! try a function on the subform table and sub form to set the additional filters. then maybe on after get record you could call the function Look at Sales Lines Explode BOM from the sales order, this inserts new lines in the subform by calling a sales line table function from the subform CurrForm.SalesLines.FORM.ExplodeBOM; But if you return a filtered set of records, you may not be able to insert in the subform until you clear the filtered record set. Have Fun David

I solved this problem with creating variable and i write to this variable line no. i need to delete/modify. Then I activate OnTimer trigger where I perform DELETE or MODIFY .