Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

MBS FileMaker Plugin Example Databases

MongoDB Audit

All examples are included with download of MBS FileMaker Plugin.

MongoDB Audit.fmp12

Overview
Tables1
Relationships0
Layouts1
Scripts4
Value Lists0
Custom Functions0
Custom Menus24
File Options
Default custom menu set[Standard FileMaker Menus]
When opening file
Minimum allowed version12.0
Login usingAccount Name; Account= Admin
Allow user to save passwordOff
Require iOS passcodeOff
Switch to layoutOff
Hide all toolbarsOff
Script triggers
OnFirstWindowOpenOff
OnLastWindowCloseOff
OnWindowOpenOff
OnWindowCloseOff
OnFileAVPlayerChangeOff
Thumbnail Settings
Generate ThumbnailsOn; Temporary

 

Tables

Table Name
Statistics
Occurrences in Relationship Graph
MongoDB Audit
8 fields defined, 1 record
MongoDB Audit

Fields

Table Name: MongoDB Audit - 8 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
PrimaryKeyNormal, TextAuto-Enter: Validation:
  • Only during data entry
  • Not empty
  • Unique
  • Strict validation
Storage:
  • Repetitions: 1
  • Indexing: Minimal
  • Automatically create indexes as needed
  • Index Language: Unicode Raw
Unique identifier of each record in this table
          CreationTimestampNormal, TimestampAuto-Enter:
          • Creation timestamp
          Validation:
          • Only during data entry
          • Strict data type: 4 digit year
          • Not empty
          • Strict validation
          Storage:
          • Repetitions: 1
          • Indexing: None
          • Automatically create indexes as needed
          • Index Language: German
          Date and time each record was created
                CreatedByNormal, TextAuto-Enter:
                • Creation account name
                Validation:
                • Only during data entry
                • Not empty
                • Strict validation
                Storage:
                • Repetitions: 1
                • Indexing: None
                • Automatically create indexes as needed
                • Index Language: German
                Account name of the user who created each record
                        ModificationTimestampNormal, TimestampAuto-Enter:
                        • Modification timestamp
                        Validation:
                        • Only during data entry
                        • Strict data type: 4 digit year
                        • Not empty
                        • Strict validation
                        Storage:
                        • Repetitions: 1
                        • Indexing: None
                        • Automatically create indexes as needed
                        • Index Language: German
                        Date and time each record was last modified
                                ModifiedByNormal, TextAuto-Enter:
                                • Modification account name
                                Validation:
                                • Only during data entry
                                • Not empty
                                • Strict validation
                                Storage:
                                • Repetitions: 1
                                • Indexing: None
                                • Automatically create indexes as needed
                                • Index Language: German
                                Account name of the user who last modified each record
                                        MongoDB URLNormal, TextAuto-Enter:
                                        • Allow editing
                                        Validation:
                                        • Only during data entry
                                        Storage:
                                        • Global
                                        • Repetitions: 1
                                        • Index Language: English
                                            Database NameNormal, TextAuto-Enter:
                                            • Allow editing
                                            Validation:
                                            • Only during data entry
                                            Storage:
                                            • Global
                                            • Repetitions: 1
                                            • Index Language: English
                                                ChangeNormal, TextAuto-Enter:
                                                • Allow editing
                                                Validation:
                                                • Only during data entry
                                                Storage:
                                                • Repetitions: 1
                                                • Indexing: None
                                                • Automatically create indexes as needed
                                                • Index Language: German

                                                      Layout Objects: MongoDB Audit

                                                      Regular Fields

                                                      Field Name: MongoDB Audit::MongoDB URL
                                                      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                      • Top: 30 pt
                                                      • Left: 151 pt
                                                      • Bottom: 61 pt
                                                      • Right: 404 pt
                                                      • Anchoring: Left, Top
                                                      Field Format:
                                                      • Edit Box
                                                      Field Behavior:
                                                      • Allow field to be entered: In Find mode, In Browse mode
                                                      • Touch keyboard type: Default for Data Type
                                                      • Go to next field using: Tab key
                                                      No

                                                      Field Name: MongoDB Audit::Database Name
                                                      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                      • Top: 65 pt
                                                      • Left: 151 pt
                                                      • Bottom: 96 pt
                                                      • Right: 404 pt
                                                      • Anchoring: Left, Top
                                                      Field Format:
                                                      • Edit Box
                                                      Field Behavior:
                                                      • Allow field to be entered: In Find mode, In Browse mode
                                                      • Touch keyboard type: Default for Data Type
                                                      • Go to next field using: Tab key
                                                      No

                                                      Field Name: MongoDB Audit::Change
                                                      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                      • Top: 117 pt
                                                      • Left: 195 pt
                                                      • Bottom: 304 pt
                                                      • Right: 1018 pt
                                                      • Anchoring: Left and Right, Top
                                                      Field Format:
                                                      • Edit Box
                                                      Field Behavior:
                                                      • Allow field to be entered: In Find mode, In Browse mode
                                                      • Touch keyboard type: Default for Data Type
                                                      • Go to next field using: Tab key
                                                      Yes

                                                      Field Name: MongoDB Audit::CreationTimestamp
                                                      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                      • Top: 260 pt
                                                      • Left: 7 pt
                                                      • Bottom: 291 pt
                                                      • Right: 187 pt
                                                      • Anchoring: Left, Top
                                                      Field Format:
                                                      • Edit Box
                                                      Field Behavior:
                                                      • Allow field to be entered: In Find mode, In Browse mode
                                                      • Touch keyboard type: Default for Data Type
                                                      • Go to next field using: Tab key
                                                      Yes

                                                      Buttons

                                                      Button PropertiesCoordinatesScript/Script Step
                                                        Type:
                                                      • Text: Start Watching
                                                      • Top: 73 pt
                                                      • Left: 447 pt
                                                      • Bottom: 104 pt
                                                      • Right: 577 pt
                                                      • Anchoring: Left, Top
                                                      Perform Script [ “Start” ]

                                                      Scripts:


                                                      Script Hierarchy

                                                      Start
                                                      LogChange
                                                      Stop
                                                      Clear

                                                      Next Script: [LogChange]
                                                      Script NameStart
                                                      Run script with full access privilegesOff
                                                      Siri Shortcut VisibleOff
                                                      Include In MenuYes
                                                      Layouts that use this script
                                                      Scripts that use this script
                                                        Script Definition
                                                        Script Steps
                                                        • Go to Layout [ “MongoDB Audit” ]
                                                        • Delete All Records [ No dialog ]
                                                        • Set Variable [ $Mongo; Value:MBS( "MongoDB.New" ) ]
                                                        • If [ MBS("IsError") ]
                                                        • Show Custom Dialog [ Title: "Failed to create new MongoDB object"; Message: $Mongo; Default Button: “OK”, Commit: “Yes” ]
                                                        • Exit Script [ ]
                                                        • End If
                                                        • Set Variable [ $r; Value:MBS( "MongoDB.SetURI"; $Mongo; MongoDB Audit::MongoDB URL) ]
                                                        • If [ MBS("IsError") ]
                                                        • Set Variable [ $x; Value:MBS( "MongoDB.Release"; $Mongo ) ]
                                                        • Show Custom Dialog [ Title: "Failed to parse connection string."; Message: $r; Default Button: “OK”, Commit: “Yes” ]
                                                        • Exit Script [ ]
                                                        • End If
                                                        • Set Variable [ $r; Value:MBS( "MongoDB.Connect"; $Mongo) ]
                                                        • If [ MBS("IsError") ]
                                                        • Set Variable [ $x; Value:MBS( "MongoDB.Release"; $Mongo ) ]
                                                        • Show Custom Dialog [ Title: "Failed to connect to MongoDB."; Message: $r; Default Button: “OK”, Commit: “Yes” ]
                                                        • Exit Script [ ]
                                                        • End If
                                                        • Set Variable [ $r; Value:MBS( "MongoDB.OpenDatabase"; $Mongo; MongoDB Audit::Database Name) ]
                                                        • If [ MBS("IsError") ]
                                                        • Set Variable [ $x; Value:MBS( "MongoDB.Release"; $Mongo ) ]
                                                        • Show Custom Dialog [ Title: "Failed to open database."; Message: $r; Default Button: “OK”, Commit: “Yes” ]
                                                        • Exit Script [ ]
                                                        • End If
                                                        • Set Variable [ $r; Value:MBS( "MongoDB.WatchDatabase"; $Mongo; "{}" ) ]
                                                        • If [ MBS("IsError") ]
                                                        • Set Variable [ $x; Value:MBS( "MongoDB.Release"; $Mongo ) ]
                                                        • Show Custom Dialog [ Title: "Failed to watch database."; Message: $r; Default Button: “OK”, Commit: “Yes” ]
                                                        • Exit Script [ ]
                                                        • End If
                                                        • #success
                                                        • Set Variable [ $$MongoConnection; Value:$Mongo ]
                                                        • #schedule an expression to check status regularly every 5 seconds...
                                                        • Set Variable [ $$MongoSchedule; Value:MBS( "Schedule.EvaluateAfterDelay"; 5 /* DelaySeconds*/; "Let([ json = MBS( \"MongoDB.NextChange\"; $$MongoConnection ); r = If(Length(json) > 0; MBS( \"FM.RunScript\"; \"MongoDB Audit\"; \"LogChange\"; json); 0)]; \"\")"; "" /* ScriptFileName*/; "" /* ScriptName*/; 5 /* RepeatDelay*/ ) ]
                                                        Fields used in this script
                                                        Scripts used in this script
                                                          Layouts used in this script
                                                          Tables used in this script
                                                          Table occurrences used by this script
                                                          Custom Functions used by this script
                                                            Custom menu set used by this script

                                                              Previous Script: [Start]Next Script: [Stop]
                                                              Script NameLogChange
                                                              Run script with full access privilegesOff
                                                              Siri Shortcut VisibleOff
                                                              Include In MenuYes
                                                              Layouts that use this script
                                                                Scripts that use this script
                                                                  Script Definition
                                                                  Script Steps
                                                                  • #we trigger this script to do the logging
                                                                  • Set Variable [ $json; Value:MBS( "JSON.Colorize"; Get(ScriptParameter)) ]
                                                                  • Set Variable [ $r; Value:MBS( "FM.InsertRecord"; "MongoDB Audit"; "MongoDB Audit"; "Change"; $json) ]
                                                                  Fields used in this script
                                                                    Scripts used in this script
                                                                      Layouts used in this script
                                                                        Tables used in this script
                                                                          Table occurrences used by this script
                                                                            Custom Functions used by this script
                                                                              Custom menu set used by this script

                                                                                Previous Script: [LogChange]Next Script: [Clear]
                                                                                Script NameStop
                                                                                Run script with full access privilegesOff
                                                                                Siri Shortcut VisibleOff
                                                                                Include In MenuYes
                                                                                Layouts that use this script
                                                                                  Scripts that use this script
                                                                                    Script Definition
                                                                                    Script Steps
                                                                                    • If [ Length ( $$MongoDB ) > 0 ]
                                                                                    • Set Variable [ $r; Value:MBS( "Schedule.Release"; $$MongoSchedule ) ]
                                                                                    • Set Variable [ $r; Value:MBS( "MongoDB.Release"; $$MongoConnection) ]
                                                                                    • Set Variable [ $$MongoConnection; Value:"" ]
                                                                                    • Set Variable [ $$MongoSchedule; Value:"" ]
                                                                                    • End If
                                                                                    Fields used in this script
                                                                                      Scripts used in this script
                                                                                        Layouts used in this script
                                                                                          Tables used in this script
                                                                                            Table occurrences used by this script
                                                                                              Custom Functions used by this script
                                                                                                Custom menu set used by this script

                                                                                                  Previous Script: [Stop]
                                                                                                  Script NameClear
                                                                                                  Run script with full access privilegesOff
                                                                                                  Siri Shortcut VisibleOff
                                                                                                  Include In MenuYes
                                                                                                  Layouts that use this script
                                                                                                    Scripts that use this script
                                                                                                      Script Definition
                                                                                                      Script Steps
                                                                                                      • Go to Layout [ “MongoDB Audit” ]
                                                                                                      • Delete All Records [ No dialog ]
                                                                                                      Fields used in this script
                                                                                                        Scripts used in this script
                                                                                                          Layouts used in this script
                                                                                                          Tables used in this script
                                                                                                            Table occurrences used by this script
                                                                                                              Custom Functions used by this script
                                                                                                                Custom menu set used by this script

                                                                                                                  Download example: MongoDB Audit

                                                                                                                  Used functions: