5 Replies Latest reply on Jun 11, 2015 12:11 PM by electon

    Script question

    burghfan

      This may be very simple or very difficult, but as I'm not very knowledgeable regarding scripts I must ask.

       

      Is there a script or is it possible through the use of a script to have a custom confirmation message appear that is generated when a "add new record" button is selected.  I'm looking for message that would open a window asking something like "are you sure you want to create a new record" thus giving the user the ability to back out of creating a new record, or confirm the decision to generate a new record.

        • 1. Re: Script question
          electon

          I know of at least two approaches.

          1 is to use an OnRecordLoad script step attached to the layout.

               there you need to look with the Get ( RecordOpenState ) for 1:

               1 returns for a new record that hasn't been commited.

               then your dialog box and Revert Record on cancel.

          2 is to use custom menus. There you can attach your own script steps.

          • 2. Re: Script question
            DavidZakary

            If you want to change the behavior of the buttons on the toolbar you need to create a custom menu set and have a script replace the functionality of the Add New Record item. Your script can do anything - such as prompt a user with a custom dialog box. This will require FileMaker Pro Advanced in order to create the custom menu.

            • 3. Re: Script question
              burghfan

              I failed to mention the "add new record" button is a custome button generated via filemaker in layout mode, and not the "new record" button in the filemaker menu bar.

              • 4. Re: Script question
                burghfan

                Would this method show that same message when just opening that layout?

                • 5. Re: Script question
                  electon

                  No, because you're trapping for a specific case: a new record being created.

                  The trigger will fire every time you go to another record and when entering the layout, but the overhead is not that big.

                  Just consider it in your own solution and possibly for looping through records use another layout.