When does the OnInsert trigger run on a table?
1. Before the record is inserted into the database.
2. After the record is inserted into the database.
In the manual 80436_NAV2013_ENUS_CSINTRO_02 its written "OnInsert contains statements that
implement after a new record is inserted into the table."
But in MSDN
http://msdn.microsoft.com/en-us/library/dd301307.aspx
Its given "This trigger executes before default insert behavior occurs. The new record is not inserted if an error occurs in the trigger code."
Which is correct ?
Comments
The reality is that first the OnInsert-trigger is executed and if no error happens, the record is inserted.
The correct exam-response is what they define as correct (and it is not always the reality).
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
You can simply write ERROR('hi'); in OnInsert trigger of Sales Header table
and try to insert new Sales Order record.
It will show error message and the record is not inserted.
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav