AnsweredAssumed Answered

Custom Menus - Inconsistent variable assessment

Question asked by Andy Hibbs on Mar 11, 2018
Latest reply on Mar 15, 2018 by Andy Hibbs


FileMaker Pro 16 Advanced 16.0.5.500

Mac OS X High Sierra 10.13.3

MacBook Retina 12" 2017 i5

 

This has taken a fair chunk of my time this morning, but I've attached a file that replicates the problem.

 

An OnLayoutEnter script trigger runs the 'LoadMenuSet' script with a parameter of 1

The script sets the script parameter '$noRecords' to '1' then installs the 'CustomSet' menu

The 'RecordsCopy' custom menu has 'If ( $noRecords = 1 ; 0 ; 1 )' set within 'Install When' (we initially tried "" instead of '0')

 

The Records menu is not suppressed when:

     The script is run without the script debugger

     The script is run with the debugger but the Step Out/F7 key is depressed

     The last active entry in the script is 'Install Menu Set'

 

The Records menu is suppressed when:

     An additional script step follows the 'Install Menu Set' entry, including 'End If' (we've used Commit Records in the attached)

     and

     The script is run with the debugger on and the Step over/F5 key is depressed

     or

     The script is run with the debugger on and the Step into/F6 key is depressed

 

I could understand it if this didn't work at all and would abandon the use of variables when setting the custom menu. However, as it does work with the Step over/Step into script debugger buttons, it would appear that it should.

 

I'm having to now setup multiple custom menus to get around this problem or try populating global fields to see if that works.

 

Not great for our productivity I'm afraid.

 

Regards

Andy

Attachments

Outcomes