In one of my projects in FileMaker, we have developed a messaging functionality that will allow the application users to communicate with each other via sending text message while they are operating the application. We had designed the messaging feature to give a visual indication to the users in the same application/system that there is a new message for them and the user will check the message list/inbox to find the new message.
But later there is a client requirement to automatically trigger a sound file to play as soon as a new message arrives to User’s dashboard and the solution needs to be web compatible. To implement this feature in a FileMaker application, we used the 360Works SuperContainer and zippscript plugins. |
1. Create an .html file with following codes. Let’s name it as “PlaySound.html“. |
- Upload the “PlaySound.html” file to the Server using 360Works SuperContainer plug-in. Visit 360Works SuperContainer link to learn more about SuperContainer plug-in
- Upload a sound/audio file to the Server using 360Works SuperContainer plug-in
- In the FileMaker layout where the user would like to get the new message alert, add a web viewer. Set the calculation of the web viewer as follows.
If ( Count ( New_Message_For_User ) > 0 ; ; "about blank" )
The above web viewer will reload the URL based on the calculation whenever the user will navigate to the FileMaker layout. The user will get a new message sound alert only once when he will navigate to that screen. This method will work for both FM Pro client and IWP users.
If the user is on the screen and a new message arrives then the user will not get any sound alert because the web viewer has not reloaded or refreshed to play sound.
- Following method will describe how to automatically play sound alert in such case.
Step1: Write a script that will have script steps to set the reload the above specified web viewer and update a global field in local table to the .
Step2: Define an unstored calculation field in the local table (on which the target screen is based) that will store the .
Step3: Trigger the script to execute whenever the Unstored Calculation Field (defined in Step 2) is greater than the Global Field (Field Updated in the script defined in Step 3). You can use zippscript or any other trigger script plug-in to trigger a script when a field value changes.
This way even if the user is already on the target screen, then also he will get a sound alert when a new message comes in.