Edit Mode
Modal Edit Mode
One of the main features of SeedCode Complete is that is fully transactional with a dedicated edit mode for making changes. The User enters a modal edit state and then must press Save Or Cancel to save the changes to the database. This includes changes in Portals and Items linked and created using the Selectors.
Contacts In edit Mode
Editing These Layouts
With edit mode being modal just can't just drop into layout mode in the middle of an edit. If you're using FileMaker 16, you can easily find the panel you're looking for using the Layout Objects window: this post shows you how.
If you're using FileMaker 15 or earlier, this video shows you the very easy method we use to edit these panels in layout mode:
On Commit Script Trigger
The primary mechanism for enforcing the modal edit mode is the On Commit Script Trigger. This is a Pre event trigger which means that if it is set to return a false result: Exit Script [Result: False] then the record cannot commit.
You can see from the above script, that if the variable $$sc_noCommit is set to 1 then the trigger can only return False and the record can't commit. So essentially when we enter Edit Mode we set $$sc_noCommit to one only the Cancel or Save buttons will clear that variable and allow the record to Commit.
Getting Stuck
It's not uncommon to make a change to one of these routines during development and accidentally get stuck in edit mode. If you're using FileMaker Advanced you can use the script debugger to skip over the Exit Script [Result: False] to get out. We've also added a special CustomMenu to serve as an Atomic Revert if the debugger is not available.