Save

The Save command allows you to commit any pending changes you have in a given Context [more info], which can span one or more Layouts [more info], to the database in a single Transaction.

Save Features

The  Save command is the single command responsible for saving all changes against the currently active layout.

By providing one single command for saving it makes the processes easy, consistent and transparent about how to save, and what the system will be saving wherever you are throughout the application.

The Save command operates against the currently active Layout only. It is only available to execute if the currently active layout has any pending changes [illustrated by having a '* ' preceding the name of the item in the layout tab].

The Save command itself is usually visible wherever you are in an application. It should be visible on every main menu, and on quick action menus too.


Custom Save Actions

The default behavior for the Save command is to immediately attempt to commit all changes against the currently active Layout.

However for certain items the Save command can initiate a custom Save dialog process first. This is common on Transactional [more info] based items, such as Period Ends, that run intensive algorithms and would rather offload that as a Server Task during the Save process.

For instance when Saving changes against a Period End you are presented with this dialog box first:

This allows you to cancel the save process, or change some of the parameters before saving. With most Transactional items this allows you to set the Status, and indicate the recalculation process should occur too.

Once you've made any custom dialog selections to the Save process it will then continue as normal.


Save Process

When you execute a Save command it runs the following process:

  • Is only possible to execute if the Layout has pending changes.
    • Some Save commands can be executed without changes on certain Layouts. This are typically Transactional items that allow you to just force a recalculation through a custom Save dialog when clicking Save.
  • Gathers all changed entities into a single commit operation
  • Runs any custom processes and algorithms
    • Gathers all changes made by those algorithms into the single commit operation
    • Runs any custom processes and algorithms on the new changes from these processes and algorithms.
      This process repeats until there are no more new changes
  • Runs through all changed data and performs permission checks
  • Performs and cascade deletion
  • Runs through all validation checks, including custom ones
  • Commits all changes to the database in a single transaction

If anything failed, then nothing was committed to the database at all. It's an all or nothing process. Any error messages will be displayed to the user to allow you to rectify them before trying again.

If the Save succeeded then the system will refresh the active layout (and any others using the same Context) to acquire a new fresh Context (with no changes), and to display the newly changed data.