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

MBS FileMaker Plugin Example Databases

Java Example

All examples are included with download of MBS FileMaker Plugin.

Java Example.fmp12

Overview
Tables1
Relationships0
Layouts1
Scripts7
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
OnFirstWindowOpenScript: Start
OnLastWindowCloseOff
OnWindowOpenOff
OnWindowCloseOff
OnFileAVPlayerChangeOff
Thumbnail Settings
Generate ThumbnailsOn; Temporary

 

Tables

Table Name
Statistics
Occurrences in Relationship Graph
Java Test
4 fields defined, 1 record
Java Test

Fields

Table Name: Java Test - 4 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
Path to Java LibraryNormal, TextAuto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Repetitions: 1
  • Indexing: None
  • Automatically create indexes as needed
  • Index Language: German
      ClassPath1Normal, TextAuto-Enter:
      • Allow editing
      Validation:
      • Only during data entry
      Storage:
      • Repetitions: 1
      • Indexing: None
      • Automatically create indexes as needed
      • Index Language: German
          ClassPath2Normal, TextAuto-Enter:
          • Allow editing
          Validation:
          • Only during data entry
          Storage:
          • Repetitions: 1
          • Indexing: None
          • Automatically create indexes as needed
          • Index Language: German
              ClassPath3Normal, TextAuto-Enter:
              • Allow editing
              Validation:
              • Only during data entry
              Storage:
              • Repetitions: 1
              • Indexing: None
              • Automatically create indexes as needed
              • Index Language: German

                  Layout Objects: Java Test

                  Regular Fields

                  Field Name: Java Test::Path to Java Library
                  Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                  • Top: 66 pt
                  • Left: 142 pt
                  • Bottom: 87 pt
                  • Right: 395 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: Java Test::ClassPath1
                  Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                  • Top: 89 pt
                  • Left: 142 pt
                  • Bottom: 110 pt
                  • Right: 395 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: Java Test::ClassPath2
                  Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                  • Top: 112 pt
                  • Left: 142 pt
                  • Bottom: 133 pt
                  • Right: 395 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: Java Test::ClassPath3
                  Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                  • Top: 135 pt
                  • Left: 142 pt
                  • Bottom: 156 pt
                  • Right: 395 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: Initialize
                  • Top: 186 pt
                  • Left: 67 pt
                  • Bottom: 217 pt
                  • Right: 197 pt
                  • Anchoring: Left, Top
                  Perform Script [ “Initialize” ]

                  Scripts:


                  Button PropertiesCoordinatesScript/Script Step
                    Type:
                  • Text: Call Object Method
                  • Top: 226 pt
                  • Left: 67 pt
                  • Bottom: 257 pt
                  • Right: 197 pt
                  • Anchoring: Left, Top
                  Perform Script [ “call object method” ]

                  Scripts:


                  Button PropertiesCoordinatesScript/Script Step
                    Type:
                  • Text: Test Object Method
                  • Top: 267 pt
                  • Left: 67 pt
                  • Bottom: 298 pt
                  • Right: 197 pt
                  • Anchoring: Left, Top
                  Perform Script [ “test object methods” ]

                  Scripts:


                  Button PropertiesCoordinatesScript/Script Step
                    Type:
                  • Text: Test Object Field
                  • Top: 308 pt
                  • Left: 67 pt
                  • Bottom: 339 pt
                  • Right: 197 pt
                  • Anchoring: Left, Top
                  Perform Script [ “test object field” ]

                  Scripts:


                  Button PropertiesCoordinatesScript/Script Step
                    Type:
                  • Text: Test Static Field
                  • Top: 349 pt
                  • Left: 67 pt
                  • Bottom: 380 pt
                  • Right: 197 pt
                  • Anchoring: Left, Top
                  Perform Script [ “test static field” ]

                  Scripts:


                  Script Hierarchy

                  Initialize
                  call object method
                  test object methods
                  test object field
                  test static field
                  Start
                  Clear Fields

                  Next Script: [call object method]
                  Script NameInitialize
                  Run script with full access privilegesOff
                  Include In MenuYes
                  Layouts that use this script
                  Scripts that use this script
                    Script Definition
                    Script Steps
                    • Set Variable [ $r; Value:MBS("Trace") ]
                    • Set Variable [ $r; Value:MBS("Java.Initialize"; Java Test::Path to Java Library; Java Test::ClassPath1 & ¶ & Java Test::ClassPath2 & ¶ & Java Test::ClassPath3) ]
                    • If [ MBS("Java.Initialized") ]
                    • Show Custom Dialog [ Title: "Java"; Message: "Java initialized."; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ]
                    • Else
                    • Show Custom Dialog [ Title: "Java"; Message: "Java failed to initialize" & ¶ & $r; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ]
                    • 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: [Initialize]Next Script: [test object methods]
                            Script Namecall object method
                            Run script with full access privilegesOff
                            Include In MenuYes
                            Layouts that use this script
                            Scripts that use this script
                              Script Definition
                              Script Steps
                              • Set Variable [ $j; Value:MBS( "Java.NewClassObject"; "test"; "<init>"; "()V") ]
                              • Set Variable [ $r; Value:MBS( "Java.CallObjectMethod"; $j; "getValue"; "()I" ) ]
                              • Show Custom Dialog [ Title: "value"; Message: $r; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ]
                              • Set Variable [ $r; Value:MBS( "Java.Release"; $j) ]
                              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: [call object method]Next Script: [test object field]
                                            Script Nametest object methods
                                            Run script with full access privilegesOff
                                            Include In MenuYes
                                            Layouts that use this script
                                            Scripts that use this script
                                              Script Definition
                                              Script Steps
                                              • Set Variable [ $j; Value:MBS( "Java.NewClassObject"; "test"; "<init>"; "()V") ]
                                              • Set Variable [ $r; Value:MBS( "Java.CallObjectMethod"; $j; "setValue"; "(I)V"; 1234 ) ]
                                              • Set Variable [ $r; Value:MBS( "Java.CallObjectMethod"; $j; "getValue"; "()I") ]
                                              • Show Custom Dialog [ Title: "value"; Message: $r; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ]
                                              • Set Variable [ $r; Value:MBS( "Java.Release"; $j) ]
                                              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: [test object methods]Next Script: [test static field]
                                                            Script Nametest object field
                                                            Run script with full access privilegesOff
                                                            Include In MenuYes
                                                            Layouts that use this script
                                                            Scripts that use this script
                                                              Script Definition
                                                              Script Steps
                                                              • Set Variable [ $j; Value:MBS( "Java.NewClassObject"; "test"; "<init>"; "()V") ]
                                                              • Set Variable [ $r; Value:MBS( "Java.SetObjectField"; $j; "value"; "I"; 2345) ]
                                                              • Set Variable [ $r; Value:MBS( "Java.GetObjectField"; $j; "value"; "I") ]
                                                              • Show Custom Dialog [ Title: "value"; Message: $r; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ]
                                                              • Set Variable [ $r; Value:MBS( "Java.Release"; $j) ]
                                                              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: [test object field]Next Script: [Start]
                                                                            Script Nametest static field
                                                                            Run script with full access privilegesOff
                                                                            Include In MenuYes
                                                                            Layouts that use this script
                                                                            Scripts that use this script
                                                                              Script Definition
                                                                              Script Steps
                                                                              • Set Variable [ $r; Value:MBS( "Java.SetStaticField"; "test"; "n"; "I"; 3456) ]
                                                                              • Set Variable [ $r; Value:MBS( "Java.GetStaticField"; "test"; "n"; "I") ]
                                                                              • Show Custom Dialog [ Title: "value"; Message: $r; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ]
                                                                              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: [test static field]Next Script: [Clear Fields]
                                                                                            Script NameStart
                                                                                            Run script with full access privilegesOff
                                                                                            Include In MenuYes
                                                                                            Layouts that use this script
                                                                                              Scripts that use this script
                                                                                                Script Definition
                                                                                                Script Steps
                                                                                                • #Locate jar file in same folder as database. (will not work on Server!)
                                                                                                • Set Variable [ $databasePath; Value:Get(FilePath) ]
                                                                                                • Set Variable [ $databasePath; Value:MBS("Path.FilemakerPathToNativePath"; $databasePath) ]
                                                                                                • Set Variable [ $databasePath; Value:Substitute ( $databasePath ; ".fp7" ; ".fmp12") ]
                                                                                                • Set Variable [ $databaseName; Value:Get(FileName) & ".fmp12" ]
                                                                                                • Set Variable [ $path; Value:Substitute ( $databasePath ; $databaseName ; "test.jar" ) ]
                                                                                                • Set Field [ Java Test::ClassPath1; $path ]
                                                                                                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]
                                                                                                        Script NameClear Fields
                                                                                                        Run script with full access privilegesOff
                                                                                                        Include In MenuYes
                                                                                                        Layouts that use this script
                                                                                                          Scripts that use this script
                                                                                                            Script Definition
                                                                                                            Script Steps
                                                                                                            • Set Field [ Java Test::Path to Java Library; "" ]
                                                                                                            • Set Field [ Java Test::ClassPath1; "" ]
                                                                                                            • Set Field [ Java Test::ClassPath2; "" ]
                                                                                                            • Set Field [ Java Test::ClassPath3; "" ]
                                                                                                            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: Java Example

                                                                                                                    Used functions: