2 Replies Latest reply on Dec 18, 2015 10:50 AM by fclark

    re-calculate custom menu items based on global variable.

    fclark

      Greetings Readers,


      I have a custom menu item that is calculated "Mode "&if($$MODE = 1;"ON";"OFF")

       

      A script changes $$MODE. I want user feedback in the custom menus . ie it should toggle "on" or "off" based on that global variable.

       

      How can I get that menu item, to re-evaluate / display appropriately?

       

      I have tried going to another layout, then going to original layout , committing the record, refreshing the window flushing all.

       

      I have tried going to another layout, changing the variable then going back to the original layout.

       

      Must I "install menu set" explicitly?

        • 1. Re: re-calculate custom menu items based on global variable.
          Extensitech

          Must I "install menu set" explicitly?

          Short answer is yes... but I would expect switching layouts and switching back to resintall the menu. (Incidentally, switching to another window and switching back will reinstall the menu.)

           

          If you explicitly reinstall the menu, does it work?

           

          I'd also put "Mode "&if($$MODE = 1;"ON";"OFF") in the data viewer and make sure you're getting the result you think you are. Is $$MODE perhaps getting reset during your layout switching?

           

          Chris Cain

          Extensitech

          • 2. Re: re-calculate custom menu items based on global variable.
            fclark

            Thank you Mr. Cain for your input.

             

            Installing the menus works, but to programmatically assign the custom menu to be reloaded was daunting.  I sought the advantage of a window switch as you suggest. Will be exploring this idea. In the mean time I have started explicitly loading them.

             

            My problem is compounded by the fact that when I pull down the custom menu to install from the list, the one that populates is not my selection. I must randomly select items from the filemaker drop down until my intended selection is inserted as the menu to load.

             

            With that in mind I wonder if the layout switch should work, and that it may be failing in my case because of some file corruption or damaged custom menus? More testing of course.