When I enter a new record via a form, I need to copy the record in another table in a specific format. I created the code and it worked with some test values.
The problem is that when I run the code in the onInsert trigger, the record isn't inserted yet and then I can not lookup values of the record.
Is there something like an afterInsert trigger or another way to do this ?
Thanks in advance,
Geert
0
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
The problem is when I 've added a new record, this new record is not yet in the employee table because I use the onInsert trigger.
If I use the rec, then I must create my xml file manually.
Any tips are welcome because I'm quit new in Navision and don't know what all the objects can do.
Kind regards,
Geert
Another idea is to create a button in your form that will export the contents of any record in the table to the other table.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
OnInsert
Rec.INSERT;
//Do what you need to do after insert
Rec.DELETE; // Delete the Rec so navision can add it.
I would appreciate comments.
Cheers
That is Brutal :P
Just used it in a similar situation I was having and it seems to work just fine. I'll keep testing to make sure it works correctly.
edit: also works for making an OnAfterModify trigger.
OnModify
Rec.MODIFY;
// OnAfterModify Code
Thanks naso!