Restricting table operations

You can restrict a table operation by form using the form form_name parameter of the Trigger_RegisterDatabase() function. A form restriction ensures that a database trigger is activated only if the table operation originates from the specified form. This is useful when you want to complete table operations in your application based on actions the user takes in a Microsoft Dynamics GP form, such as browsing, saving or deleting records. Without a form restriction, a table operation anywhere in the system will activate a corresponding database trigger.

A restriction prohibits the trigger from activating when a database operation occurs from other locations in the system. Therefore, you should not use a restriction if you use database triggers to enforce referential integrity constraints between Microsoft Dynamics GP records and third-party records.


A database trigger with a form restriction runs only if the table operation uses the form’s record buffer. For instance, if the form’s Save button calls a procedure which then saves a record to a table, the database trigger won’t run (you’re using the procedure’s record buffer, not the form’s). However, if the Save button passes the form’s record buffer to the procedure, the database trigger runs because you’re still using the form’s record buffer.

Microsoft Dynamics GP forms typically don’t delete or save records using a procedure. They use either a field change script or a form procedure, where a script passes the record buffer to the form procedure.



Documentation Feedback