5 Replies Latest reply on May 29, 2014 8:39 AM by philmodjunk

    Help required with button programming

    MichaelHammond

      Title

      Help required with button programming

      Post

           HI All

           We are a paramedic company and using Filemaker to record our patient records - I DO NOT KNOW HOW TO CODE

           I have a button setup to display a HANDOVER REPORT which we can then print and give to the local ambulance crew

           my problem - I would like the handover report only to display if the initial and secondary patient observation details have been completed

           there are several field in each of the initial and secondary sections - so if data is missing some sort of ALERT to get the Paramedics to complete this data before printing the HANDOVER REPORT

           the initial - red and secondary - yellow sections must be complete to allow button fpr handover report to display

           is this possible

           thanks in advance

           mike

      Screenshot_2014-05-28_13.06.05.png

        • 1. Re: Help required with button programming
          philmodjunk
               

                    I DO NOT KNOW HOW TO CODE

               Will then make it difficult to help you.

               A conditional format expression such as the following could make an alert notice in the form of layout text visible on your screen:

               Not ( IsEmpty ( YourTable::BP ) or IsEmpty ( YourTable::Heart Rate ) or IsEmpty ( YourTable::SPO2 ) or IsEmpty ( YourTable::BSL) or IsEmpty ( YourTable::Resps) or IsEmpty ( YourTable::Temp) or IsEmpty ( YourTable::BP 2 ) or IsEmpty ( YourTable::Heart Rate 2 ) or IsEmpty ( YourTable::SPO2 2 ) or IsEmpty ( YourTable::BSL 2) or IsEmpty ( YourTable::Resps 2) or IsEmpty ( YourTable::Temp 2 ) )

               This expression returns False if any of the fields in the first two columns are empty. If you add a warning to your layout as 12 point layout text, this expression could be used to change to font size to 120+ in order to make this text invisible.

               The button to display your hand over report can start with this code:

               If [ IsEmpty ( YourTable::BP ) or IsEmpty ( YourTable::Heart Rate ) or IsEmpty ( YourTable::SPO2 ) or IsEmpty ( YourTable::BSL) or IsEmpty ( YourTable::Resps) or IsEmpty ( YourTable::Temp) or IsEmpty ( YourTable::BP 2 ) or IsEmpty ( YourTable::Heart Rate 2 ) or IsEmpty ( YourTable::SPO2 2 ) or IsEmpty ( YourTable::BSL 2) or IsEmpty ( YourTable::Resps 2) or IsEmpty ( YourTable::Temp 2 ) ]
                    Show Custom Dialog ["All required Initial and secondary fields have not been filled out." ]
               Else

                   Put the rest of your script to show your report here

               End If

          • 2. Re: Help required with button programming
            MichaelHammond

                 Hi Phil thank you for your assistance

                 I am getting the following

            • 3. Re: Help required with button programming
              philmodjunk

                   You have entered a script step that you would define in a script editor using Manage scripts as a calculation in the specify calculation dialog.

                   Open Manage | Scripts

                   Click New to start a new script.

                   Find the IF script step listed on the left and double click it to add it to your script. Double click it and add the expression between the square brackets. Do not enter the brackets.

                   Click OK

                   Then double click the Else script step to add it.

                   Double click again to add the Show Custom Dialog script step. Double Click the added Show Custom Dialog script step to open up a dialog where you can type in the message you want to appear and you can edit what buttons appear with that message.

                   You'll need to add more steps for printing your report here.

                   Then exit the script manager, return to your layout and set up your button to perform this script.

              • 4. Re: Help required with button programming
                MichaelHammond

                     Hi Phil

                     thanks again for your help

                     got the button working but when I select a new record it doesnt work

                     is it because the layout has a TAB box and this data is in the TAB so the layout still sees record 1 as having data so it lets you print?

                     any thoughts please

                     Mike

                • 5. Re: Help required with button programming
                  philmodjunk

                       The fact that it's in a tab control has nothing to do with this.

                       Creating a new record does not automatically perform this script and thus this message does not appear. You'll need to figure out each circumstance where you need this script to be run and then implement features that ensure that the script is run in each case.

                       You may need to put a button on your layout for creating new records that performs a script that first performs this script and then creates the new record.

                       Or if you are using FileMaker Advanced, you can set up a custom menu where selecting New Record performs the script that I have just described.