7 Replies Latest reply on Jan 4, 2015 1:14 PM by sfioranelli

    New Record Alert "New" and Modified Record "Modified"



      New Record Alert "New" and Modified Record "Modified"


      Could someone be so kind to inform me how to write the script to create an alert that says new when a new record is created throughout the database.  The same goes for when a document has been modified "modified". I have created already all of the timestamps throughout the database in each table. I just do not know how to write the script.

      Any help would be greatly appreciated.

        • 1. Re: New Record Alert "New" and Modified Record "Modified"

          What kind of alert do you want to generate?

          I can describe the triggers and how to set them up, but you really haven't specified what kind of alert is needed and several are possible.

          You can define a field in your table that auto-enters a serial number. Then change the options for this field to assign the serial number "on commit". You won't use this field as a primary key and won't really care what value is in the field, only is it empty or not. Now the OnRecordLoad trigger can perform a script, if your script checks this newly added field and finds that it is empty, this is a newly created record and it can generate one kind of alert or another from that context.

          The same script can copy the modification timestamp field's value to a global variable. Then a script performed by the onRecordCommit trigger can compare the current value of the modification time stamp field to the value of this global variable to see if the record has been modified.

          • 2. Re: New Record Alert "New" and Modified Record "Modified"

            Basically what I would need is kind similar to what we have on the iphone.  I have different areas which have buttons within popup buttons as the menu bar.  I would like that when new records are created in each area a 1 or 2 or 3 depending upon how many records are created in each area appear on the corresponding popup button. In this way the user automatically knows that they have to enter into that section because there is a new document to view.

            Once the user would enter into the section, the list of documents that they first view will have the word new next to the documents that have been added and modified for the documents that have been modified.

            Important is that once the documents are opened the number on the menu bar decreases and the new or modified disapears.  I hope that you understand me, it is difficult to explain. But if you need further clarification, please let me know.


            Thank you so much for your help!!  I am really stuck.

            • 3. Re: New Record Alert "New" and Modified Record "Modified"

              I'd need to know a lot more about the structure of your database and both who needs to see those indicators and who would be creating the new records.

              I would guess that this is a hosted database with multiple users creating and changing records in it at the same time?

              And Would just one user need to see all of these counts or would there be different users responsible for different subsets of the entire system.

              The basic set up however, is even simpler than my initial stab at this. You can simply have a field that is empty when the record is first created. The OnRecordLoad trigger can use Get ( account ) to check the name of the current user and if it's the designated user that needs to view this record, it can set a value into the field.

              Then an unstored calculation field can use ExecuteSQL to count the number of records in that table where this field is Null.

              • 4. Re: New Record Alert "New" and Modified Record "Modified"

                The indicators would need to be seen differently for each users that logs in based upon what they have viewed and not viewed.  There is a designated group of people who have the access rights to insert new records.

                What is the calculation that I would have to insert for the ExecuteSQL? Would this mean that once the record is opened the number would turn to 0?

                As I am not a filemaker specialist could you be so kind to be more specific so that I can follow the steps and see how it works?

                Thank you so much


                • 5. Re: New Record Alert "New" and Modified Record "Modified"

                  Each of your posts adds more detail that complicates what will need to be set up to do what you want.

                  There is a designated group of people who have the access rights to insert new records.

                  Ok, and you can set up access permissions to keep users not part of this group from creating new records, but that's all besides the point. The important question here is who is supposed to see and respond to these alerts? The person that creates the record does need to see an alert on that record, someone else (or several others) would apparently need to see these alerts. 


                  And if there are multiple reviewers that need to see the record, you'll probably need a related table to track who has and has not viewed that new or modified record.

                  We have to nail down those details before looking at how ExecuteSQL or some other method would be used to display those counts.

                  • 6. Re: New Record Alert "New" and Modified Record "Modified"

                    Ok All users should see that a new alert (a new document or record has been created), the same is if it is modified.  The person who created the record can see the alert, this is ok.  However, each user will have different alerts according to what they have read and not read.

                    Yes, we would need to have a related table to track ho has read and has not read the new or modified record.

                    As all of these users will see these alert numbers directly on the corresponding button for the area, when they click on the button, they will be redirected to a page with a list of all documents for that area. This is why it is also important to have the text new or modified next to the corresponding document in the portal. Once they have clicked on the corresponding document and open it up, the new or modfied text should disapear.

                    Thank you

                    • 7. Re: New Record Alert "New" and Modified Record "Modified"

                      I am sorry to disturb you, but were you able to have any luck with an idea?

                      Thank you