doubt in certification exam answer

TamalikaTamalika Member Posts: 5
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

  • krikikriki Member, Moderator Posts: 9,115
    Depends.

    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).
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • mohana_cse06mohana_cse06 Member Posts: 5,504
    1. Before the record is inserted into the database.

    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.
Sign In or Register to comment.