![]() ![]() This can be useful for calling several different transactions in one script, as well as for error handling. ![]() It returns 1 (True) if it is, and 0 (false) if not. ![]() Related to the addition of transactions, the Get (TransactionOpenState) function can be used to check if the script is currently inside a transaction environment or not. Once this script step is called, it ignores any other lines of the script between itself and the 'Commit Transaction' script step and runs that step next. You can set this script step to only activate based on specific conditions, and you can also optionally have it throw an error code and message in the script if it activates. Revert Transaction: Discards any data changes the transaction made.Regardless of whether the user chooses to keep or discard the transaction, this script step must be called to close the transaction environment. Commit Transaction: Ends the current transaction.You can make as many changes to the database as you want inside a single transaction, but keep in mind it will all be reverted unless explicitly committed via the 'Commit Transaction' script step. If the script ends before reaching the commit step, it will automatically revert the transaction. Any changes in database records made after this step will be stored inside the transaction and will not be committed or reverted until the relevant transaction script step is called. Open Transaction: This step initiates the start of the transaction.While Filemaker has had the capability of performing transactions via scripts, in the past it involved manually setting up a transactional environment and database tables dedicated to transactions to help with performing this extremely useful action, Claris has added three script steps explicitly for use with transactions. They are typically used for the mass creation, editing, or deletion of records where you want to ensure the entire set of data is valid, and if it is not, discarding the entire transaction as if the script itself never ran. Transactions are an excellent way to bundle sets of actions together, executing them or reverting them as a whole instead of a several smaller pieces. Arguably the largest new feature that 19.6 brings to the table is built-in support for transactions. ![]()
0 Comments
Leave a Reply. |