8 Replies Latest reply on Jun 30, 2016 12:08 AM by Stigge

    Button Magic


      I'm sure someone has posted this before, but a quick search didn't reveal anything. We're currently going through our SaleFaith systems and gradually replacing the old graphics with new buttons using the button tool and standard icons.


      We were pleased to see that if you use 'Insert Merge Field' or 'Insert Variable' on a layout, copy either of these and paste them into the text field in 'Button Setup' the data will display in browse mode. The global variable needed a window refresh after evaluating, but this opens up all sorts of options, such as multi-lingual or conditional button text.


      We've only been playing with this and have no idea on the overheads, but just in case I was the only person who didn't know this.....





        • 1. Re: Button Magic

          Thanks for sharing. Very useful technique and a welcome evolutionary step towards a button name powered by the calculation engine (my guess is FMP 17).


          Michael Richards

          Brisbane (Australia)

          • 2. Re: Button Magic

            Button bar in FM14 already allow calculation, OTOH it disallow merge**.


            Using merge field as button name was apparent technique on old FM versions that button name was simply a text. It looks be hidden by introduced "button setup" dialog.

            • 3. Re: Button Magic



              Yes I did think about the old technique when I posted, but this was just a separate object on a layout.


              However, I didn't think merging within the button setup dialogue box text was obvious as there is no access to the calculation engine (as yet) from it.


              Appreciate the replies



              • 4. Re: Button Magic

                Hi Guys.


                This sounds interesting, a trick i havent discovered yet.. =D (am still a beginner.)

                Is it possible that you explain in a bit more simpler way what this is ? maby if someone have a simple example that i can view ? =)




                • 5. Re: Button Magic

                  Hi Stigge


                  Sure. When you are in layout mode you can insert a field or a global variable ($$ prefix) on to a layout using the Insert menu and select either 'Merge Field...' or 'Merge Variable' options (at the bottom of the menu). This will insert either of these within << >> parameters. Whenever the field contains a value or if the variable is set, the values will be displayed on the layout.


                  If you use the button tool to draw a button and select any of the options for displaying text, e.g. 'New' for a new record button, if you copy either of the merge field or merge variable text from the layout and copy into the button setup text, the buttons will display the values.


                  In the attached images the Demo Button.jpg shows layout mode with both a merge field and merge variable inserted on a layout and in this case the variable has been copied and pasted into the text field in the button tool. In the Demo Button 2.jpg in browse mode we've used the data viewer in FileMaker Advanced to evaluate the $$varName with the value 'My Button Text' (which you'd normally do using a script). Both the layout and the button displays this value, if we set $$varName to something else, then both the layout and button values will change, albeit after a window refresh, which again can be scripted.


                  I hope the above makes some sense.


                  Button Demo.jpgButton Demo 2.jpg

                  • 6. Re: Button Magic

                    As you know, they don't need to be copy & pasted, you can simply type it in as is. Copied from merge field may have advantage avoiding mis type, but variable?

                    • 7. Re: Button Magic

                      Yup, agreed again!

                      • 8. Re: Button Magic

                        Thank you !!

                        Thats an awesome function ! opens doors for flexabilities and re-using of code and space.. =)

                        Like it ! =)