MBS FileMaker Plugin Example Databases

TableStatistic

All examples are included with download of MBS FileMaker Plugin.

TableStatistic.fmp12

Overview
Tables2
Relationships0
Layouts2
Scripts1
Value Lists0
Custom Functions0
Custom Menus0
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
Contacts
9 fields defined, 3 records
Contacts
Images
7 fields defined, 2 records
Images

Fields

Table Name: Contacts - 9 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
UniqueIDNormal, NumberAuto-Enter:
  • Serial: Generate: On creation, Next value: 4, Increment: 1
Validation:
  • Only during data entry
Storage:
  • Repetitions: 1
  • Indexing: None
  • Automatically create indexes as needed
  • Index Language: English
          Created_TimeStampNormal, TimestampAuto-Enter:
          • Creation timestamp
          Validation:
          • Only during data entry
          • Strict validation
          Storage:
          • Repetitions: 1
          • Indexing: All
          • Index Language: English
                  Created_AccountNameNormal, TextAuto-Enter:
                  • Creation account name
                  Validation:
                  • Only during data entry
                  • Strict validation
                  Storage:
                  • Repetitions: 1
                  • Indexing: All
                  • Index Language: English
                          Modified_TimeStampNormal, TimestampAuto-Enter:
                          • Modification timestamp
                          • Allow editing
                          Validation:
                          • Only during data entry
                          • Strict validation
                          Storage:
                          • Repetitions: 1
                          • Indexing: All
                          • Index Language: English
                                  Modified_AccountNameNormal, TextAuto-Enter:
                                  • Modification account name
                                  Validation:
                                  • Only during data entry
                                  • Strict validation
                                  Storage:
                                  • Repetitions: 1
                                  • Indexing: All
                                  • Index Language: English
                                          OneCalculated, NumberCalculation: Auto-Enter:
                                          • Always evaluate
                                          Storage:
                                          • Repetitions: 1
                                          • Indexing: None
                                          • Automatically create indexes as needed
                                          • Index Language: English
                                                FirstNormal, TextAuto-Enter:
                                                • Allow editing
                                                Validation:
                                                • Only during data entry
                                                Storage:
                                                • Repetitions: 1
                                                • Indexing: None
                                                • Automatically create indexes as needed
                                                • Index Language: English
                                                      LastNormal, TextAuto-Enter:
                                                      • Allow editing
                                                      Validation:
                                                      • Only during data entry
                                                      Storage:
                                                      • Repetitions: 1
                                                      • Indexing: None
                                                      • Automatically create indexes as needed
                                                      • Index Language: English
                                                            etcNormal, TextAuto-Enter:
                                                            • Allow editing
                                                            Validation:
                                                            • Only during data entry
                                                            Storage:
                                                            • Repetitions: 1
                                                            • Indexing: None
                                                            • Automatically create indexes as needed
                                                            • Index Language: English

                                                                  Table Name: Images - 7 Fields
                                                                  Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
                                                                  UniqueIDNormal, NumberAuto-Enter:
                                                                  • Serial: Generate: On creation, Next value: 3, Increment: 1
                                                                  Validation:
                                                                  • Only during data entry
                                                                  Storage:
                                                                  • Repetitions: 1
                                                                  • Indexing: None
                                                                  • Automatically create indexes as needed
                                                                  • Index Language: English
                                                                          Created_TimeStampNormal, TimestampAuto-Enter:
                                                                          • Creation timestamp
                                                                          Validation:
                                                                          • Only during data entry
                                                                          • Strict validation
                                                                          Storage:
                                                                          • Repetitions: 1
                                                                          • Indexing: All
                                                                          • Index Language: English
                                                                                  Created_AccountNameNormal, TextAuto-Enter:
                                                                                  • Creation account name
                                                                                  Validation:
                                                                                  • Only during data entry
                                                                                  • Strict validation
                                                                                  Storage:
                                                                                  • Repetitions: 1
                                                                                  • Indexing: All
                                                                                  • Index Language: English
                                                                                          Modified_TimeStampNormal, TimestampAuto-Enter:
                                                                                          • Modification timestamp
                                                                                          • Allow editing
                                                                                          Validation:
                                                                                          • Only during data entry
                                                                                          • Strict validation
                                                                                          Storage:
                                                                                          • Repetitions: 1
                                                                                          • Indexing: All
                                                                                          • Index Language: English
                                                                                                  Modified_AccountNameNormal, TextAuto-Enter:
                                                                                                  • Modification account name
                                                                                                  Validation:
                                                                                                  • Only during data entry
                                                                                                  • Strict validation
                                                                                                  Storage:
                                                                                                  • Repetitions: 1
                                                                                                  • Indexing: All
                                                                                                  • Index Language: English
                                                                                                          OneCalculated, NumberCalculation: Auto-Enter:
                                                                                                          • Always evaluate
                                                                                                          Storage:
                                                                                                          • Repetitions: 1
                                                                                                          • Indexing: None
                                                                                                          • Automatically create indexes as needed
                                                                                                          • Index Language: English
                                                                                                                ContainerNormal, BinaryAuto-Enter:
                                                                                                                • Allow editing
                                                                                                                Validation:
                                                                                                                • Only during data entry
                                                                                                                Storage:
                                                                                                                • Repetitions: 1

                                                                                                                      Layout Objects: Contacts

                                                                                                                      Regular Fields

                                                                                                                      Field Name: Contacts::One
                                                                                                                      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                                                      • Top: 52 pt
                                                                                                                      • Left: 138 pt
                                                                                                                      • Bottom: 73 pt
                                                                                                                      • Right: 217 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

                                                                                                                      Field Name: Contacts::First
                                                                                                                      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                                                      • Top: 75 pt
                                                                                                                      • Left: 138 pt
                                                                                                                      • Bottom: 96 pt
                                                                                                                      • Right: 391 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

                                                                                                                      Field Name: Contacts::Last
                                                                                                                      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                                                      • Top: 98 pt
                                                                                                                      • Left: 138 pt
                                                                                                                      • Bottom: 119 pt
                                                                                                                      • Right: 391 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

                                                                                                                      Field Name: Contacts::etc
                                                                                                                      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                                                      • Top: 121 pt
                                                                                                                      • Left: 138 pt
                                                                                                                      • Bottom: 142 pt
                                                                                                                      • Right: 391 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: Table Statistics
                                                                                                                      • Top: 10 pt
                                                                                                                      • Left: 26 pt
                                                                                                                      • Bottom: 41 pt
                                                                                                                      • Right: 155 pt
                                                                                                                      • Anchoring: Left, Top
                                                                                                                      Perform Script [ “TableStatistic” ]

                                                                                                                      Scripts:


                                                                                                                      Layout Objects: Images

                                                                                                                      Regular Fields

                                                                                                                      Field Name: Images::One
                                                                                                                      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                                                      • Top: 52 pt
                                                                                                                      • Left: 138 pt
                                                                                                                      • Bottom: 73 pt
                                                                                                                      • Right: 217 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

                                                                                                                      Field Name: Images::Container
                                                                                                                      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                                                      • Top: 75 pt
                                                                                                                      • Left: 138 pt
                                                                                                                      • Bottom: 200 pt
                                                                                                                      • Right: 391 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

                                                                                                                      Buttons

                                                                                                                      Button PropertiesCoordinatesScript/Script Step
                                                                                                                        Type:
                                                                                                                      • Text: Table Statistics
                                                                                                                      • Top: 7 pt
                                                                                                                      • Left: 20 pt
                                                                                                                      • Bottom: 38 pt
                                                                                                                      • Right: 149 pt
                                                                                                                      • Anchoring: Left, Top
                                                                                                                      Perform Script [ “TableStatistic” ]

                                                                                                                      Scripts:


                                                                                                                      Script Hierarchy

                                                                                                                      TableStatistic

                                                                                                                      Script NameTableStatistic
                                                                                                                      Run script with full access privilegesOff
                                                                                                                      Include In MenuYes
                                                                                                                      Layouts that use this script
                                                                                                                      Scripts that use this script
                                                                                                                        Script Definition
                                                                                                                        Script Steps
                                                                                                                        • #This script is total independent of TOs etc. It just uses variables, Copy & Paste it anywhere in your solution
                                                                                                                        • Set Variable [ $TableNames; Value:TableNames(Get(FileName)) ]
                                                                                                                        • Set Variable [ $NumberOfTables; Value:ValueCount ( $TableNames) ]
                                                                                                                        • Set Variable [ $Counter; Value:1 ]
                                                                                                                        • Set Variable [ $TotalSize; Value:0 ]
                                                                                                                        • Set Variable [ $Report; Value:"Table Statistics for File: " & Get(FileName) & "¶¶" & "Number of tables: " & $NumberOfTables & "¶" ]
                                                                                                                        • Loop
                                                                                                                        • Set Variable [ $MyTable; Value:GetValue ( $TableNames; $Counter ) ]
                                                                                                                        • Set Variable [ $r; Value:MBS("FM.TableStatistics" ; "" ; $MyTable ) ]
                                                                                                                        • Set Variable [ $Keys; Value:JSONListKeys ( $r ; "" ) ]
                                                                                                                        • Set Variable [ $NumberOfKeys; Value:ValueCount ( $Keys ) ]
                                                                                                                        • Set Variable [ $IndexToKey; Value:1 ]
                                                                                                                        • Set Variable [ $Size; Value:0 ]
                                                                                                                        • Loop
                                                                                                                        • Set Variable [ $MyElement; Value:GetValue ( $Keys ; $IndexToKey ) ]
                                                                                                                        • If [ PatternCount ($MyElement ; "ContainerByteSize" ) > 0 ]
                                                                                                                        • Set Variable [ $Size; Value:$Size + JSONGetElement ( $r ; $MyElement ) ]
                                                                                                                        • Set Variable [ $TotalSize; Value:$TotalSize + JSONGetElement ( $r ; $MyElement ) ]
                                                                                                                        • End If
                                                                                                                        • If [ PatternCount ($MyElement ; "AllTextLengths" ) > 0 ]
                                                                                                                        • Set Variable [ $Size; Value:$Size + 2 * (JSONGetElement ( $r ; $MyElement )) ]
                                                                                                                        • Set Variable [ $TotalSize; Value:$TotalSize + 2 * (JSONGetElement ( $r ; $MyElement )) ]
                                                                                                                        • End If
                                                                                                                        • Set Variable [ $IndexToKey; Value:$IndexToKey + 1 ]
                                                                                                                        • Exit Loop If [ $IndexToKey > $NumberofKeys ]
                                                                                                                        • End Loop
                                                                                                                        • Set Variable [ $Report; Value:$Report & "¶" & $MyTable & ": " & $Size & " Bytes" ]
                                                                                                                        • Set Variable [ $Counter; Value:$Counter + 1 ]
                                                                                                                        • Exit Loop If [ $Counter > $NumberOfTables ]
                                                                                                                        • End Loop
                                                                                                                        • Set Variable [ $Report; Value:$Report & "¶¶" & "Total: " & $TotalSize & " Bytes" ]
                                                                                                                        • Show Custom Dialog [ Title: "MBS - FM.TableStatistics"; Message: $Report; Default Button: “OK”, Commit: “Yes” ]
                                                                                                                        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: TableStatistic

                                                                                                                                      Used functions:




                                                                                                                                      Links
                                                                                                                                      MBS Xojo Plugins