Custom Menu - Overview

I am working on a deep dive into FileMaker Custom Menus with the goals to work out a plan to:

  1. Provide the best possible Custom Menu UI/UX
  2. Have the code be as simple as possible (but no simpler)
  3. Make the deploying of the code as easy as possible

Since Custom Menus is a big topic, I am planning on posting separate pages with this page serving as the Overview and Table of Contents page.

For a topic with as much complexity as Custom Menus, I like to take screen captures and lay them out as infographics that make visible the lay of the land that we will be navigating.

This page is a work in progress...

Overview:
// Work in Progress infoG

Custom Menu
// lots of flexibility here because of all the "Specify..." calculation choices

2 Likes

Good luck with this one @tonywhitelive.

The specify calculation within Edit Custom Menu was one of the best things FileMaker/Claris ever did. I hope you add some advice as to not use over-complex calculations, particularly ExecuteSQL in these for performance purposes.

Well done!!

I almost never use ExecuteSQL, for a number of reasons...

[1] Minimizing indirection (so that we can rename fields and table occurrences to increase code readability).

[2] Avoiding performance issues when you query a record that is open

[3] Avoiding the [formerly] irreversible file bloat.

"Serious Data Viewer issue: Using ExecuteSQL causes unlimited irreversible file bloat."

https://community.claris.com/en/s/question/0D50H00007uuNPnSAM/serious-data-viewer-issue-using-executesql-causes-unlimited-irreversible-file-bloat

There are better ways to do the same things WITHOUT using ExecuteSQL, IMO.

More to come on Custom Menus as I catch up!

1 Like

Ouch. I didn't know about that. Do we have a way of diagnosing this issue? Aside from bloating and excess bits, are there any way do definitely tell if a file has this issue? I have two systems that I look after that could be affected but I don't want to pull them down and mess around unless that is necessary.

1 Like

Hi Tony

At the risk of moving off topic, but wanting to add a balancing view on ExecuteSQL (eSQL), here we go...

[1] Use a set of custom functions to achieve robust coding that accommodates FileMaker's ability to rollout changes to field, table and table occurrence names throughout its structure. For instance, for a table occurrence of 'Contacts', we would create:

"SELECT FirstName FROM Contacts"
as
"SELECT " & SQLFIELD ( Contacts::Firstname ) & "
FROM " & SQLTABLE ( Contacts::SerialIDField )

This ensures that any changes made will not break our eSQL calculations.

[2] eSQL can be horribly slow over a WAN if a record is left in an open state.

However, using a procedure of collecting data required for the calculation in variables first, then commit the record and set another variable using eSQL before setting a field can be very quick. Using PSOS of course can help in certain circumstances.

eSQL can also help with overall performance by reducing the number of table occurrences needed to create reports, hence reducing the structural overhead of the system. We often build complex reports based only on limited IDs, sometimes in dedicated generic tables, by looping through each record, setting variables using eSQL and then setting the required fields.

In our opinion eSQL should never be used in calculation fields, set field, replace field contents, etc, but always within scripts to set variables prior to setting field values. This follows our principle of putting as much business intelligence into scripts, rather than database structure.

[3] As you mention, this has been fixed. However, my understanding of the main problem was that it was linked to JOINs, which in themselves can slow down eSQL calculations. Like everything to do with FileMaker, there is usually the obvious way of doing something, then alternatives that can improve performance. In our case, we hardly ever use a JOIN, preferring to use IN, which usually provides far faster calculations.

I'd agree that there are some things that may be better ways than using eSQL. I'd also argue that there are some things where using eSQL can also be the better way. IMO.

There is no one feature in FileMaker that should always be used for a particular task. The toolkit Claris have provided us with is wide and varied and all should be considered during our development.

Anyone considering whether to, or deciding not to use eSQL could do worse than read:

Hopefully, this will not turn your post into a pro/anti eSQL and I look forward to more Custom Menu info.

Kind regards

Andy

3 Likes