MBS FileMaker Plugin Example Databases

WMI Query

All examples are included with download of MBS FileMaker Plugin.

WMI Query.fmp12

Overview
Tables2
Relationships1
Layouts3
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
WMI Query
7 fields defined, 14 records
WMI Query
Result
4 fields defined, 0 record
Result

Fields

Table Name: WMI Query - 7 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
NetworkResourceNormal, TextAuto-Enter:
  • Constant data: root\cimv2
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Repetitions: 1
  • Indexing: None
  • Automatically create indexes as needed
  • Index Language: German
      UserNormal, TextAuto-Enter:
      • Allow editing
      Validation:
      • Only during data entry
      Storage:
      • Repetitions: 1
      • Indexing: None
      • Automatically create indexes as needed
      • Index Language: German
          PasswordNormal, TextAuto-Enter:
          • Allow editing
          Validation:
          • Only during data entry
          Storage:
          • Repetitions: 1
          • Indexing: None
          • Automatically create indexes as needed
          • Index Language: German
              LocaleNormal, TextAuto-Enter:
              • Allow editing
              Validation:
              • Only during data entry
              Storage:
              • Repetitions: 1
              • Indexing: None
              • Automatically create indexes as needed
              • Index Language: German
                  AuthorityNormal, TextAuto-Enter:
                  • Allow editing
                  Validation:
                  • Only during data entry
                  Storage:
                  • Repetitions: 1
                  • Indexing: None
                  • Automatically create indexes as needed
                  • Index Language: German
                      QueryNormal, TextAuto-Enter:
                      • Allow editing
                      Validation:
                      • Only during data entry
                      Storage:
                      • Repetitions: 1
                      • Indexing: None
                      • Automatically create indexes as needed
                      • Index Language: German
                          QueryIDNormal, TextAuto-Enter:
                          • Allow editing
                          Validation:
                          • Only during data entry
                          Storage:
                          • Repetitions: 1
                          • Indexing: Minimal
                          • Automatically create indexes as needed
                          • Index Language: German

                              Table Name: Result - 4 Fields
                              Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
                              NameNormal, TextAuto-Enter:
                              • Allow editing
                              Validation:
                              • Only during data entry
                              Storage:
                              • Repetitions: 1
                              • Indexing: None
                              • Automatically create indexes as needed
                              • Index Language: German
                                  TypeNormal, TextAuto-Enter:
                                  • Allow editing
                                  Validation:
                                  • Only during data entry
                                  Storage:
                                  • Repetitions: 1
                                  • Indexing: None
                                  • Automatically create indexes as needed
                                  • Index Language: German
                                      TextNormal, TextAuto-Enter:
                                      • Allow editing
                                      Validation:
                                      • Only during data entry
                                      Storage:
                                      • Repetitions: 1
                                      • Indexing: None
                                      • Automatically create indexes as needed
                                      • Index Language: German
                                          QueryIDNormal, TextAuto-Enter:
                                          • Allow editing
                                          Validation:
                                          • Only during data entry
                                          Storage:
                                          • Repetitions: 1
                                          • Indexing: Minimal
                                          • Automatically create indexes as needed
                                          • Index Language: German

                                              Layout Objects: WMI Query

                                              Regular Fields

                                              Field Name: WMI Query::NetworkResource
                                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                              • Top: 36 pt
                                              • Left: 138 pt
                                              • Bottom: 58 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: System Default
                                              • Go to next field using: Tab key
                                              Yes

                                              Field Name: WMI Query::User
                                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                              • Top: 60 pt
                                              • Left: 138 pt
                                              • Bottom: 82 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: System Default
                                              • Go to next field using: Tab key
                                              Yes

                                              Field Name: WMI Query::Password
                                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                              • Top: 84 pt
                                              • Left: 138 pt
                                              • Bottom: 106 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: System Default
                                              • Go to next field using: Tab key
                                              Yes

                                              Field Name: WMI Query::Locale
                                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                              • Top: 108 pt
                                              • Left: 138 pt
                                              • Bottom: 130 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: System Default
                                              • Go to next field using: Tab key
                                              Yes

                                              Field Name: WMI Query::Authority
                                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                              • Top: 132 pt
                                              • Left: 138 pt
                                              • Bottom: 154 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: System Default
                                              • Go to next field using: Tab key
                                              Yes

                                              Field Name: WMI Query::Query
                                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                              • Top: 199 pt
                                              • Left: 138 pt
                                              • Bottom: 242 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: System Default
                                              • Go to next field using: Tab key
                                              Yes

                                              Buttons

                                              Button PropertiesCoordinatesScript/Script Step
                                                Type:
                                              • Text: Query
                                              • Top: 201 pt
                                              • Left: 424 pt
                                              • Bottom: 233 pt
                                              • Right: 526 pt
                                              • Anchoring: Left, Top
                                              Perform Script [ “Query” ]

                                              Scripts:


                                              Layout Objects: Result

                                              Regular Fields

                                              Field Name: Result::Name
                                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                              • Top: 70 pt
                                              • Left: 5 pt
                                              • Bottom: 92 pt
                                              • Right: 213 pt
                                              • Anchoring: Left, Top
                                              Field Format:
                                              • Edit Box
                                              Field Behavior:
                                              • Allow field to be entered: In Find mode, In Browse mode
                                              • Touch keyboard type: System Default
                                              • Go to next field using: Tab key
                                              Yes

                                              Field Name: Result::Type
                                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                              • Top: 70 pt
                                              • Left: 220 pt
                                              • Bottom: 92 pt
                                              • Right: 311 pt
                                              • Anchoring: Left, Top
                                              Field Format:
                                              • Edit Box
                                              Field Behavior:
                                              • Allow field to be entered: In Find mode, In Browse mode
                                              • Touch keyboard type: System Default
                                              • Go to next field using: Tab key
                                              Yes

                                              Field Name: Result::Text
                                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                              • Top: 70 pt
                                              • Left: 318 pt
                                              • Bottom: 92 pt
                                              • Right: 571 pt
                                              • Anchoring: Left, Top
                                              Field Format:
                                              • Edit Box
                                              Field Behavior:
                                              • Allow field to be entered: In Find mode, In Browse mode
                                              • Touch keyboard type: System Default
                                              • Go to next field using: Tab key
                                              Yes

                                              Buttons

                                              Button PropertiesCoordinatesScript/Script Step
                                                Type:
                                              • Text: Go Back
                                              • Top: 6 pt
                                              • Left: 14 pt
                                              • Bottom: 28 pt
                                              • Right: 115 pt
                                              • Anchoring: Left, Top
                                              Go to Layout [ “WMI Query” (WMI Query) ]

                                              Layouts:


                                              Script Hierarchy

                                              Query

                                              Script NameQuery
                                              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 [ $q; Value:MBS("Trace") ]
                                                • Set Variable [ $q; Value:MBS("WMIQuery.New") ]
                                                • If [ MBS("IsError") = 0 ]
                                                • Set Field [ WMI Query::QueryID; $q ]
                                                • #connect to server
                                                • Set Variable [ $r; Value:MBS("WMIQuery.Connect"; $q; WMI Query::NetworkResource; WMI Query::User; WMI Query::Password; WMI Query::Locale; WMI Query::Authority) ]
                                                • If [ MBS("IsError") = 0 ]
                                                • #run query
                                                • Set Variable [ $r; Value:MBS("WMIQuery.Query"; $q; WMI Query::Query) ]
                                                • If [ MBS("IsError") = 0 ]
                                                • #show result
                                                • Go to Related Record [ From table: “Result”; Using layout: “Result” (Result) ] [ Show only related records ]
                                                • Go to Layout [ “Result” (Result) ]
                                                • Delete All Records [ No dialog ]
                                                • Loop
                                                • Set Variable [ $r; Value:MBS("WMIQuery.Next"; $q) ]
                                                • Exit Loop If [ $r ≠ "OK" ]
                                                • #show properties
                                                • Set Variable [ $Names; Value:MBS("WMIQuery.PropertyNames"; $q) ]
                                                • If [ MBS("IsError") ]
                                                • Show Custom Dialog [ Title: "Query Error"; Message: $r; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                • Exit Script [ ]
                                                • Else
                                                • #loop properties
                                                • Set Variable [ $count; Value:ValueCount ( $Names ) ]
                                                • Set Variable [ $index; Value:1 ]
                                                • Loop
                                                • #property name, type and value
                                                • Set Variable [ $name; Value:GetValue($Names; $index) ]
                                                • Set Variable [ $type; Value:MBS("WMIQuery.PropertyType"; $q; $name) ]
                                                • Set Variable [ $value; Value:MBS("WMIQuery.PropertyValue"; $q; $name) ]
                                                • New Record/Request
                                                • Set Field [ Result::Name; $name ]
                                                • Set Field [ Result::Type; $type ]
                                                • Set Field [ Result::Text; $value ]
                                                • Set Field [ Result::QueryID; $q ]
                                                • Commit Records/Requests [ No dialog ]
                                                • #next
                                                • Set Variable [ $index; Value:$index +1 ]
                                                • Exit Loop If [ $index > $count ]
                                                • End Loop
                                                • End If
                                                • End Loop
                                                • Else
                                                • Show Custom Dialog [ Title: "Query Error"; Message: $r; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                • End If
                                                • Else
                                                • Show Custom Dialog [ Title: "Connect Error"; Message: $r; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                • End If
                                                • #cleanup
                                                • Set Variable [ $r; Value:MBS("WMIQuery.Release"; $q) ]
                                                • 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

                                                      Download example: WMI Query

                                                      Used functions:




                                                      Links
                                                      MBS FileMaker blog