9 Replies Latest reply on Jun 20, 2013 8:30 AM by philmodjunk

    Make a "ding" sound when a new record is added

    MaxwellRobin

      Title

      Make a "ding" sound when a new record is added

      Post

           Hi All!

           I have a table, which gets shared on a network

           A person adds a new record to the table and everyone else on the network should see it

           What I would like is for all the computers who did not create the record to "ding" or make a noise every time a new record is added. Sort of like a notification.

           Is this possible?

           Thanks!

           Maxwell

        • 1. Re: Make a "ding" sound when a new record is added
          philmodjunk

               If there is some value in that new record that identifies it as "new", then this might be possible. There'd need to be a script that periodically checks for such new values and then either plays the system sound using the Beep step or plays a sound recorded in a container field.

               The Install OnTimer Script could be used to set up such a periodic check script.

          • 2. Re: Make a "ding" sound when a new record is added
            MaxwellRobin

                 Could I possibly have two global fields?

                 One that contains the total number of records and is continually counting?

                 And another that checks to see if its total matches and if not it dings and replaces its value with the new total?

                 would that seem logical?

            • 3. Re: Make a "ding" sound when a new record is added
              philmodjunk

                   That's certainly one method that can work if you aren't also deleting records. There's a parameter you can use with the Get function to get the total records in a table.

                   But it's not the only method. If your records have an auto-entered serial number, you can start the process with a script that loads a global variable or field with the maximum serial number. Then a relationship or a scripted find can look for any records with serial numbers greater than that saved value. Not only can this detect the presence of new records, it can find and display them as well.

              • 4. Re: Make a "ding" sound when a new record is added
                MaxwellRobin

                     Yes, your second idea sounds like what I want.

                     Could you go into more detail on how I should go about this?

                     Also, how do i go about making my "ding" sound work?

                     I have an audio file I would like to use.

                • 5. Re: Make a "ding" sound when a new record is added
                  philmodjunk

                       I can only generalize without a more detailed understanding of what you are trying to set up. You'll need to subsitute your table occurrence and field names for mine:

                       Script 1:

                       #Get serial number of most recently created record
                       Go to layout [//specify layout based on table in question]
                       Show All Records
                       Sort Records [Restore ; No dialog ] --> sort by serial number field in descending order
                       Go to Record/Request/Page [First]
                       Set Variable [$$MaxSerial ; Value: YourTable::SerialNumberField ]

                       Script 2:

                       #Find any records created since Script 1 was performed
                       Enter Find mode []
                       Set Field [YourTable::SerialNumberField ; ">" & $$MaxSerial ]
                       Set Error Capture [on]
                       Perform Find []
                       If [ Get ( FoundCount ) // records were found ]
                          Go to Field [Globals::gYourContainerField ; Select/perform ] --> field must be present on current layout for sound to be "played"
                          Perform Script [Script #1 ] ----> Update $$MaxSerial so that these records aren't found as new records the next time around.
                       End If

                  • 6. Re: Make a "ding" sound when a new record is added
                    MaxwellRobin

                         so i got it to work. my next question is, am i able to make it only play the sound on certain computers on my network?

                         could i set up a button and an 'if' statement that will only make the sound active if clicked

                         really what i would like is to create records on my machine and either the other one or two computers will make the sound if they like.

                         but it would have to be able to work on either 1 machine, 2 machines, or all three

                         can a button or field be separated like that?

                         thoughts? does this make any sense at all?

                          

                         Thanks!

                         Maxwell

                    • 7. Re: Make a "ding" sound when a new record is added
                      philmodjunk

                           I've recommended that this be done with the Install OnTimer Script, script step. You need only run that script on the computers where this is desired. You could simply put a button on your layout that performs that one line script. Click it if you want the notifications to take place. Don't click it if you don't.

                           and this script:

                           Install OnTimer Script []

                           with nothing specified in the brackets will turn off the timer so you can also add a button to stop the notifications.

                      • 8. Re: Make a "ding" sound when a new record is added
                        MaxwellRobin

                             AH! Works great! Ive tested it on my computer and the button works fine. I have a global field which i use to validate which state the text should be in on the button. the text has a condition where if the field says "1" the "on" text size is at 100 and if the field says "0" the "off" text size is 100. the script on the button turns on and off the timer and resets the global field to the other number. will this conflict with my idea of having this script only run on certain computers on my network. i dont have too much knowlege about how filemaker works with networked computers.

                              

                             Thanks!

                              

                             Maxwell

                        • 9. Re: Make a "ding" sound when a new record is added
                          philmodjunk

                               When you run that script you are setting up a "timer" on just one window on just one computer. It has no effect on what happens on a different computer. If you have database open on 3 computers and you want this timer running on two of them, click this button on those two computers and not the third.