JSON Transactional Edits in FileMaker 16

FileMaker 16 was announced this morning and I’m excited to show you a couple of things it can do. You may remember a couple of posts: FileMaker User Interface Design – Time for a change and Contextual Mode Shifting – It’s a Thing! Both Techniques showed us how to have a cleaner design in “Browse Mode” making important information stand out and protecting data but “Edit Mode” allowed fields to be enterable.

Previous to FileMaker 16 we used global fields for Edit Mode so when the “Edit icon” was clicked the main field values would get copied to global fields. Clicking “Save” after making changes would copy from the globals back to the main fields, or clicking “Cancel” would clear the globals. This method has been working but we wanted to try something new and the JSON functions in FileMaker 16 have allowed us to do that.

Browse Mode

Edit Mode

How Does it Work?

Clicking either of the Edit buttons, a JSON string ($$JSON) is created based on the current values of the fields in the current record. The field names are captured from a designated layout CON_edit_fields, that is used as a template.  The Edit panel is then opened allowing the user to make changes.

Edit Mode Using Custom Function

This is the Custom Function that builds the JSON string.

Edit Mode Using Script Loop

Two Options Are Available In Edit Mode

Save – Commits the record and clears the global variable.

Cancel – Parses the data out of the $$JSON variable, and resets the original fields to their original values.

View JSON for Current Record

Clicking this button will present a Card Window which is another new feature of FileMaker 16.

The scripting requires that a layout exists with the same context as the current layout. The format of the layout name is: tablename_edit_fields.

Example:  CON_edit_fields

Modular Design

Have a good week and email me with any questions!

– James

James Scarpetta
The Scarpetta Group, Inc.
FileMaker 15 Certified Developer
james@scarpettagroup.com


2017-06-16T12:20:35+00:00 By |

About the Author:

James Scarpetta

James’ focus is designing beautiful FileMaker layouts. He has strong skills with integrations to accounting systems and translating business requirements to a successful user experience. When not building applications you can find him behind his camera.