sc_commit_trans("Connection")



This macro is used to confirm a transaction set in the database.

In form applications, there are events that perform transactions with the database (Ex: onAfterInsert, onAfterUpdate, onAfterDelete, onBeforeInsert, onBeforeUpdate, onBeforeDelete, etc...).
The transaction control of these events is done by Scriptcase itself if the connection provided is the same as the application.
However, if the user has to perform any type of redirection in these events, it is necessary to use the macro sc_commit_trans before the redirect to secure the transactions previously performed.

Ex: onAfterUpdate - Using redirection after update a record:

sc_commit_trans();

sc_redir('grid_main');


The "connection" parameter is optional, being necessary only if the command is executed in a different database specified to the application.