MBS FileMaker Plugin Example Databases

Events Sync

All examples are included with download of MBS FileMaker Plugin.

Events Sync.fmp12

Overview
Tables2
Relationships0
Layouts2
Scripts10
Value Lists2
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
Events
14 fields defined, 0 record
Events
Calendars
4 fields defined, 0 record
Calendars

Fields

Table Name: Events - 14 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
CalendarIDNormal, TextAuto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Global
  • Repetitions: 1
  • Index Language: German
        CalendarNameNormal, TextAuto-Enter:
        • Allow editing
        Validation:
        • Only during data entry
        Storage:
        • Global
        • Repetitions: 1
        • Index Language: German
            TitleNormal, TextAuto-Enter:
            • Allow editing
            Validation:
            • Only during data entry
            Storage:
            • Repetitions: 1
            • Indexing: None
            • Automatically create indexes as needed
            • Index Language: German
                URLNormal, TextAuto-Enter:
                • Allow editing
                Validation:
                • Only during data entry
                Storage:
                • Repetitions: 1
                • Indexing: None
                • Automatically create indexes as needed
                • Index Language: German
                    NoteNormal, TextAuto-Enter:
                    • Allow editing
                    Validation:
                    • Only during data entry
                    Storage:
                    • Repetitions: 1
                    • Indexing: None
                    • Automatically create indexes as needed
                    • Index Language: German
                        LocationNormal, TextAuto-Enter:
                        • Allow editing
                        Validation:
                        • Only during data entry
                        Storage:
                        • Repetitions: 1
                        • Indexing: None
                        • Automatically create indexes as needed
                        • Index Language: German
                            CalendarItemIdentifierNormal, TextAuto-Enter:
                            • Allow editing
                            Validation:
                            • Only during data entry
                            Storage:
                            • Repetitions: 1
                            • Indexing: Minimal
                            • Automatically create indexes as needed
                            • Index Language: German
                                CalendarItemExternalIdentifierNormal, TextAuto-Enter:
                                • Allow editing
                                Validation:
                                • Only during data entry
                                Storage:
                                • Repetitions: 1
                                • Indexing: None
                                • Automatically create indexes as needed
                                • Index Language: German
                                    AllDayNormal, TextAuto-Enter:
                                    • Allow editing
                                    Validation:
                                    • Only during data entry
                                    • Value list: All Day
                                    Storage:
                                    • Repetitions: 1
                                    • Indexing: None
                                    • Automatically create indexes as needed
                                    • Index Language: German
                                        AvailabilityNormal, TextAuto-Enter:
                                        • Allow editing
                                        Validation: Storage:
                                        • Repetitions: 1
                                        • Indexing: None
                                        • Automatically create indexes as needed
                                        • Index Language: German
                                            Start DateNormal, TimestampAuto-Enter:
                                            • Allow editing
                                            Validation:
                                            • Only during data entry
                                            Storage:
                                            • Repetitions: 1
                                            • Indexing: None
                                            • Automatically create indexes as needed
                                            • Index Language: German
                                                End DateNormal, TimestampAuto-Enter:
                                                • Allow editing
                                                Validation:
                                                • Only during data entry
                                                Storage:
                                                • Repetitions: 1
                                                • Indexing: None
                                                • Automatically create indexes as needed
                                                • Index Language: German
                                                    UUIDNormal, NumberAuto-Enter:
                                                    • Allow editing
                                                    • Do not replace existing value for field (if any)
                                                    • Context table: Events
                                                      Calculation: Get ( UUIDNumber )
                                                    Validation:
                                                    • Only during data entry
                                                    Storage:
                                                    • Repetitions: 1
                                                    • Indexing: All
                                                    • Index Language: German
                                                          Last Modification DateNormal, TimestampAuto-Enter:
                                                          • Modification timestamp
                                                          • Allow editing
                                                          Validation:
                                                          • Only during data entry
                                                          Storage:
                                                          • Repetitions: 1
                                                          • Indexing: None
                                                          • Automatically create indexes as needed
                                                          • Index Language: German

                                                              Table Name: Calendars - 4 Fields
                                                              Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
                                                              TitleNormal, TextAuto-Enter:
                                                                Validation:
                                                                • Only during data entry
                                                                Storage:
                                                                • Repetitions: 1
                                                                • Indexing: None
                                                                • Automatically create indexes as needed
                                                                • Index Language: German
                                                                    IDNormal, TextAuto-Enter:
                                                                      Validation:
                                                                      • Only during data entry
                                                                      Storage:
                                                                      • Repetitions: 1
                                                                      • Indexing: None
                                                                      • Automatically create indexes as needed
                                                                      • Index Language: German
                                                                            TypeNormal, TextAuto-Enter:
                                                                              Validation:
                                                                              • Only during data entry
                                                                              Storage:
                                                                              • Repetitions: 1
                                                                              • Indexing: None
                                                                              • Automatically create indexes as needed
                                                                              • Index Language: German
                                                                                  SourceNormal, TextAuto-Enter:
                                                                                    Validation:
                                                                                    • Only during data entry
                                                                                    Storage:
                                                                                    • Repetitions: 1
                                                                                    • Indexing: None
                                                                                    • Automatically create indexes as needed
                                                                                    • Index Language: German

                                                                                        Layout Objects: Events

                                                                                        Regular Fields

                                                                                        Field Name: Events::CalendarName
                                                                                        Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                        • Top: 542 pt
                                                                                        • Left: 305 pt
                                                                                        • Bottom: 563 pt
                                                                                        • Right: 558 pt
                                                                                        • Anchoring: Left, Top
                                                                                        Field Format:
                                                                                        • Edit Box
                                                                                        Field Behavior:
                                                                                        • Touch keyboard type: Default for Data Type
                                                                                        • Go to next field using: Tab key
                                                                                        No

                                                                                        Field Name: Events::Title
                                                                                        Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                        • Top: 52 pt
                                                                                        • Left: 138 pt
                                                                                        • Bottom: 73 pt
                                                                                        • Right: 558 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: Events::URL
                                                                                        Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                        • Top: 75 pt
                                                                                        • Left: 138 pt
                                                                                        • Bottom: 96 pt
                                                                                        • Right: 558 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: Events::Note
                                                                                        Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                        • Top: 98 pt
                                                                                        • Left: 138 pt
                                                                                        • Bottom: 151 pt
                                                                                        • Right: 558 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: Events::Location
                                                                                        Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                        • Top: 154 pt
                                                                                        • Left: 138 pt
                                                                                        • Bottom: 175 pt
                                                                                        • Right: 558 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: Events::CalendarItemIdentifier
                                                                                        Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                        • Top: 331 pt
                                                                                        • Left: 138 pt
                                                                                        • Bottom: 352 pt
                                                                                        • Right: 558 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: Events::CalendarItemExternalIdentifier
                                                                                        Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                        • Top: 364 pt
                                                                                        • Left: 138 pt
                                                                                        • Bottom: 385 pt
                                                                                        • Right: 558 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: Events::AllDay
                                                                                        Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                        • Top: 190 pt
                                                                                        • Left: 138 pt
                                                                                        • Bottom: 211 pt
                                                                                        • Right: 391 pt
                                                                                        • Anchoring: Left, Top
                                                                                        Field Format:
                                                                                        • Checkbox Set
                                                                                        • Display values from: All Day
                                                                                        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: Events::Availability
                                                                                        Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                        • Top: 213 pt
                                                                                        • Left: 138 pt
                                                                                        • Bottom: 234 pt
                                                                                        • Right: 391 pt
                                                                                        • Anchoring: Left, Top
                                                                                        Field Format: 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: Events::Start Date
                                                                                        Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                        • Top: 236 pt
                                                                                        • Left: 138 pt
                                                                                        • Bottom: 257 pt
                                                                                        • Right: 379 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: Events::End Date
                                                                                        Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                        • Top: 259 pt
                                                                                        • Left: 138 pt
                                                                                        • Bottom: 280 pt
                                                                                        • Right: 379 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: Events::UUID
                                                                                        Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                        • Top: 397 pt
                                                                                        • Left: 138 pt
                                                                                        • Bottom: 418 pt
                                                                                        • Right: 558 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: Events::Last Modification Date
                                                                                        Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                        • Top: 420 pt
                                                                                        • Left: 138 pt
                                                                                        • Bottom: 441 pt
                                                                                        • Right: 558 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: Select Calendar
                                                                                        • Top: 541 pt
                                                                                        • Left: 592 pt
                                                                                        • Bottom: 563 pt
                                                                                        • Right: 745 pt
                                                                                        • Anchoring: Left, Top
                                                                                        Perform Script [ “Select Calendar via card” ]

                                                                                        Scripts:


                                                                                        Button PropertiesCoordinatesScript/Script Step
                                                                                          Type:
                                                                                        • Text: Authorize
                                                                                        • Top: 541 pt
                                                                                        • Left: 18 pt
                                                                                        • Bottom: 563 pt
                                                                                        • Right: 171 pt
                                                                                        • Anchoring: Left, Top
                                                                                        Perform Script [ “Authorize” ]

                                                                                        Scripts:


                                                                                        Button PropertiesCoordinatesScript/Script Step
                                                                                          Type:
                                                                                        • Text: Set Now
                                                                                        • Top: 238 pt
                                                                                        • Left: 392 pt
                                                                                        • Bottom: 260 pt
                                                                                        • Right: 453 pt
                                                                                        • Anchoring: Left, Top
                                                                                        Set Field [ Events::Start Date; Get(CurrentHostTimestamp) ]

                                                                                        Fields:


                                                                                        Button PropertiesCoordinatesScript/Script Step
                                                                                          Type:
                                                                                        • Text: Set Now
                                                                                        • Top: 258 pt
                                                                                        • Left: 392 pt
                                                                                        • Bottom: 280 pt
                                                                                        • Right: 453 pt
                                                                                        • Anchoring: Left, Top
                                                                                        Set Field [ Events::End Date; Get(CurrentHostTimestamp) ]

                                                                                        Fields:


                                                                                        Button PropertiesCoordinatesScript/Script Step
                                                                                          Type:
                                                                                        • Text: Synchronize
                                                                                        • Top: 541 pt
                                                                                        • Left: 849 pt
                                                                                        • Bottom: 563 pt
                                                                                        • Right: 1002 pt
                                                                                        • Anchoring: Left, Top
                                                                                        Perform Script [ “Sync” ]

                                                                                        Scripts:


                                                                                        Button PropertiesCoordinatesScript/Script Step
                                                                                          Type:
                                                                                        • Text: Delete Event
                                                                                          Hide Condition:
                                                                                        • Get(RecordID) = 0
                                                                                        • Top: 75 pt
                                                                                        • Left: 867 pt
                                                                                        • Bottom: 107 pt
                                                                                        • Right: 1002 pt
                                                                                        • Anchoring: Left, Top
                                                                                        Perform Script [ “DeleteEvent” ]

                                                                                        Scripts:


                                                                                        Layout Objects: Calendars

                                                                                        Regular Fields

                                                                                        Field Name: Calendars::Title
                                                                                        Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                        • Top: 53 pt
                                                                                        • Left: 6 pt
                                                                                        • Bottom: 74 pt
                                                                                        • Right: 259 pt
                                                                                        • Anchoring: Left, Top
                                                                                        Field Format:
                                                                                        • Edit Box
                                                                                        Field Behavior:
                                                                                        • Touch keyboard type: Default for Data Type
                                                                                        • Go to next field using: Tab key
                                                                                        Yes

                                                                                        Field Name: Calendars::Type
                                                                                        Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                        • Top: 53 pt
                                                                                        • Left: 266 pt
                                                                                        • Bottom: 74 pt
                                                                                        • Right: 429 pt
                                                                                        • Anchoring: Left, Top
                                                                                        Field Format:
                                                                                        • Edit Box
                                                                                        Field Behavior:
                                                                                        • Touch keyboard type: Default for Data Type
                                                                                        • Go to next field using: Tab key
                                                                                        Yes

                                                                                        Field Name: Calendars::Source
                                                                                        Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                        • Top: 53 pt
                                                                                        • Left: 436 pt
                                                                                        • Bottom: 74 pt
                                                                                        • Right: 599 pt
                                                                                        • Anchoring: Left, Top
                                                                                        Field Format:
                                                                                        • Edit Box
                                                                                        Field Behavior:
                                                                                        • Touch keyboard type: Default for Data Type
                                                                                        • Go to next field using: Tab key
                                                                                        Yes

                                                                                        Buttons

                                                                                        Button PropertiesCoordinatesScript/Script Step
                                                                                          Type:
                                                                                        • Text: Select
                                                                                        • Top: 54 pt
                                                                                        • Left: 612 pt
                                                                                        • Bottom: 76 pt
                                                                                        • Right: 713 pt
                                                                                        • Anchoring: Left, Top
                                                                                        Perform Script [ “Pick Calendar” ]

                                                                                        Scripts:


                                                                                        Value Lists

                                                                                        Value List NameSourceValuesOn Layouts
                                                                                        AvailabilityCustom
                                                                                        • Busy, Free, Tentative, Unavailable
                                                                                        All DayCustom
                                                                                        • All Day

                                                                                        Script Hierarchy

                                                                                        Select Calendar via card
                                                                                        Pick Calendar
                                                                                        Authorize
                                                                                        Sync
                                                                                        Sync Events
                                                                                        Sync new Event in FileMaker to Calendar
                                                                                        Sync new Events from Calendar to FileMaker
                                                                                        Sync event from Calendar to FileMaker
                                                                                        Sync event from FileMaker to Calendar
                                                                                        DeleteEvent

                                                                                        Next Script: [Pick Calendar]
                                                                                        Script NameSelect Calendar via card
                                                                                        Run script with full access privilegesOff
                                                                                        Include In MenuNo
                                                                                        Layouts that use this script
                                                                                        Scripts that use this script
                                                                                          Script Definition
                                                                                          Script Steps
                                                                                          • New Window [ Style: Card; Name: "Pick Calendar"; Using layout: “Calendars” (Calendars); Height: 500; Width: 720; Close: Yes; Minimize: No; Maximize: No; Resize: No; Menu Bar: No; Dim parent window: Yes; Toolbars: No ]
                                                                                          • Go to Layout [ “Calendars” (Calendars) ]
                                                                                          • Delete All Records [ No dialog ]
                                                                                          • Set Variable [ $Calendars; Value:MBS( "Events.Calendars"; "Events") ]
                                                                                          • Set Variable [ $count; Value:ValueCount ( $Calendars ) ]
                                                                                          • Set Variable [ $index; Value:1 ]
                                                                                          • Loop
                                                                                          • Set Variable [ $id; Value:GetValue($Calendars; $index) ]
                                                                                          • Set Variable [ $source; Value:MBS( "Events.Calendar.GetSource"; $id ) ]
                                                                                          • Set Variable [ $sourceName; Value:MBS( "Events.Source.Title"; $source ) ]
                                                                                          • New Record/Request
                                                                                          • Set Field [ Calendars::ID; $id ]
                                                                                          • Set Field [ Calendars::Type; MBS( "Events.Calendar.GetType"; $id ) ]
                                                                                          • Set Field [ Calendars::Title; MBS( "Events.Calendar.GetTitle"; $id ) ]
                                                                                          • Set Field [ Calendars::Source; $sourceName ]
                                                                                          • Commit Records/Requests [ No dialog ]
                                                                                          • Set Variable [ $index; Value:$index + 1 ]
                                                                                          • Exit Loop If [ $index > $count ]
                                                                                          • End Loop
                                                                                          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: [Select Calendar via card]Next Script: [Authorize]
                                                                                                Script NamePick Calendar
                                                                                                Run script with full access privilegesOff
                                                                                                Include In MenuNo
                                                                                                Layouts that use this script
                                                                                                Scripts that use this script
                                                                                                  Script Definition
                                                                                                  Script Steps
                                                                                                  • Go to Layout [ “Calendars” (Calendars) ]
                                                                                                  • Set Field [ Events::CalendarID; Calendars::ID ]
                                                                                                  • Set Field [ Events::CalendarName; Calendars::Title ]
                                                                                                  • Delete All Records [ No dialog ]
                                                                                                  • Close Window [ Name: "Pick Calendar"; Current file ]
                                                                                                  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: [Pick Calendar]Next Script: [Sync]
                                                                                                        Script NameAuthorize
                                                                                                        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("Events.AuthorizationStatusForEntityType"; "Event") ]
                                                                                                          • If [ MBS("IsError") ]
                                                                                                          • Show Custom Dialog [ Title: "We have a problem"; Message: MBS("Text.RemovePrefix"; $r; "[MBS] "); Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                                                                          • Else If [ $r = "NotDetermined" ]
                                                                                                          • Set Variable [ $r; Value:MBS( "Events.requestAccessToEntityType"; "Event" ) ]
                                                                                                          • If [ $r = "Wait" ]
                                                                                                          • #dialog is showing.
                                                                                                          • Else If [ $r = "OK" ]
                                                                                                          • Show Custom Dialog [ Title: "Success"; Message: "We are authorized and ready to go."; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                                                                          • Else
                                                                                                          • Show Custom Dialog [ Title: "We have a problem"; Message: $r; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                                                                          • End If
                                                                                                          • Else If [ $r = "Restricted" ]
                                                                                                          • Show Custom Dialog [ Title: "Success"; Message: "We are authorized for a restricted access and ready to go."; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                                                                          • Else If [ $r = "Denied" ]
                                                                                                          • Show Custom Dialog [ Title: "Problem"; Message: "We are denied for calendar access. Please go to system preferences and enable us."; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                                                                          • Else If [ $r = "Authorized" ]
                                                                                                          • Show Custom Dialog [ Title: "Success"; Message: "We are authorized and ready to go."; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                                                                          • Else
                                                                                                          • Show Custom Dialog [ Title: "We have a problem"; Message: $r; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, 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: [Authorize]Next Script: [Sync Events]
                                                                                                                        Script NameSync
                                                                                                                        Run script with full access privilegesOff
                                                                                                                        Include In MenuYes
                                                                                                                        Layouts that use this script
                                                                                                                        Scripts that use this script
                                                                                                                          Script Definition
                                                                                                                          Script Steps
                                                                                                                          • #Cases:
                                                                                                                          • #1. New event in FM, has no IDs
                                                                                                                          • # -> Transfer to Calendar
                                                                                                                          • #2. New event calendar with ID we don't know
                                                                                                                          • # -> Transfer to FileMaker
                                                                                                                          • #3. ID in FM, but not in calendar database -> item deleted
                                                                                                                          • # -> Delete in FileMaker
                                                                                                                          • #4. ID in FM and in calendar database -> item changed?
                                                                                                                          • # -> Update in FileMaker
                                                                                                                          • #5. direct delete for cloud and FileMaker in DeleteEvent script
                                                                                                                          • Go to Layout [ “Events” (Events) ]
                                                                                                                          • If [ IsEmpty ( Events::CalendarID ) ]
                                                                                                                          • Show Custom Dialog [ Title: "Please choose calendar first."; Default Button: “OK”, Commit: “Yes” ]
                                                                                                                          • Exit Script [ Result: "No Calendar" ]
                                                                                                                          • End If
                                                                                                                          • Set Variable [ $r; Value:MBS("Events.Reset") ]
                                                                                                                          • If [ MBS("IsError") ]
                                                                                                                          • Set Variable [ $error; Value:$r ]
                                                                                                                          • Show Custom Dialog [ Title: "Failed to write record"; Message: $error; Default Button: “OK”, Commit: “Yes” ]
                                                                                                                          • Exit Script [ Result: $error ]
                                                                                                                          • End If
                                                                                                                          • Perform Script [ “Sync Events” ]
                                                                                                                          • #Find events not in FM
                                                                                                                          • Perform Script [ “Sync new Events from Calendar to FileMaker” ]
                                                                                                                          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: [Sync]Next Script: [Sync new Event in FileMaker to Calendar]
                                                                                                                              Script NameSync Events
                                                                                                                              Run script with full access privilegesOff
                                                                                                                              Include In MenuNo
                                                                                                                              Layouts that use this script
                                                                                                                                Scripts that use this script
                                                                                                                                Script Definition
                                                                                                                                Script Steps
                                                                                                                                • #Sync events
                                                                                                                                • Go to Layout [ “Events” (Events) ]
                                                                                                                                • If [ Get(FoundCount) = 0 ]
                                                                                                                                • Exit Script [ Result: "OK" ]
                                                                                                                                • End If
                                                                                                                                • Go to Record/Request/Page [ First ]
                                                                                                                                • If [ Get(LastError) ≠ 0 ]
                                                                                                                                • Exit Script [ Result: "No records?" ]
                                                                                                                                • End If
                                                                                                                                • Loop
                                                                                                                                • If [ IsEmpty ( Events::CalendarItemIdentifier ) ]
                                                                                                                                • Perform Script [ “Sync new Event in FileMaker to Calendar” ]
                                                                                                                                • Set Variable [ $ScriptResult; Value:Get(ScriptResult) ]
                                                                                                                                • If [ $ScriptResult ≠ "OK" ]
                                                                                                                                • Exit Script [ Result: $ScriptResult ]
                                                                                                                                • End If
                                                                                                                                • Else
                                                                                                                                • Set Variable [ $item; Value:Events::CalendarItemIdentifier ]
                                                                                                                                • Set Variable [ $lastModifiedDate; Value:MBS( "Events.Item.lastModifiedDate"; Events::CalendarItemIdentifier ) ]
                                                                                                                                • If [ MBS("IsError") ]
                                                                                                                                • #not found
                                                                                                                                • Set Variable [ $item; Value:MBS( "Events.CalendarItemsWithExternalIdentifier"; Events::CalendarItemExternalIdentifier ) ]
                                                                                                                                • If [ MBS("IsError") = 0 and Length ( $item ) > 0 ]
                                                                                                                                • #Got new ID on server?
                                                                                                                                • Set Field [ Events::CalendarItemIdentifier; $item ]
                                                                                                                                • Else
                                                                                                                                • #deleted?
                                                                                                                                • Set Variable [ $item; Value:"" ]
                                                                                                                                • Delete Record/Request [ No dialog ]
                                                                                                                                • If [ Get(LastError) ≠ 0 ]
                                                                                                                                • Set Variable [ $error; Value:Get ( LastExternalErrorDetail ) ]
                                                                                                                                • Show Custom Dialog [ Title: "Failed to write record"; Message: $error; Default Button: “OK”, Commit: “Yes” ]
                                                                                                                                • Exit Script [ Result: $error ]
                                                                                                                                • End If
                                                                                                                                • End If
                                                                                                                                • End If
                                                                                                                                • If [ Length ( $item ) > 0 ]
                                                                                                                                • #got modification date
                                                                                                                                • Set Variable [ $ModificationDate; Value:Events::Last Modification Date ]
                                                                                                                                • If [ $lastModifiedDate > $ModificationDate ]
                                                                                                                                • #Event in Calendar is newer
                                                                                                                                • Perform Script [ “Sync event from Calendar to FileMaker” ]
                                                                                                                                • Set Variable [ $ScriptResult; Value:Get(ScriptResult) ]
                                                                                                                                • If [ $ScriptResult ≠ "OK" ]
                                                                                                                                • Exit Script [ Result: $ScriptResult ]
                                                                                                                                • End If
                                                                                                                                • Else If [ $lastModifiedDate < $ModificationDate ]
                                                                                                                                • #Event in FileMaker is newer
                                                                                                                                • Perform Script [ “Sync event from FileMaker to Calendar” ]
                                                                                                                                • Set Variable [ $ScriptResult; Value:Get(ScriptResult) ]
                                                                                                                                • If [ $ScriptResult ≠ "OK" ]
                                                                                                                                • Exit Script [ Result: $ScriptResult ]
                                                                                                                                • End If
                                                                                                                                • Else
                                                                                                                                • #ignore
                                                                                                                                • End If
                                                                                                                                • End If
                                                                                                                                • End If
                                                                                                                                • Go to Record/Request/Page [ Next; Exit after last ]
                                                                                                                                • End Loop
                                                                                                                                • Exit Script [ Result: "OK" ]
                                                                                                                                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: [Sync Events]Next Script: [Sync new Events from Calendar to FileMaker]
                                                                                                                                    Script NameSync new Event in FileMaker to Calendar
                                                                                                                                    Run script with full access privilegesOff
                                                                                                                                    Include In MenuNo
                                                                                                                                    Layouts that use this script
                                                                                                                                      Scripts that use this script
                                                                                                                                      Script Definition
                                                                                                                                      Script Steps
                                                                                                                                      • #New event in FileMaker, so we create in calendar database
                                                                                                                                      • Go to Layout [ “Events” (Events) ]
                                                                                                                                      • Set Variable [ $item; Value:MBS( "Events.NewEvent" ) ]
                                                                                                                                      • Set Variable [ $r; Value:MBS( "Events.Item.SetCalendar"; $item; Events::CalendarID ) ]
                                                                                                                                      • If [ not IsEmpty ( Events::Location ) ]
                                                                                                                                      • Set Variable [ $r; Value:MBS( "Events.Item.SetLocation"; $item; Events::Location) ]
                                                                                                                                      • End If
                                                                                                                                      • If [ not IsEmpty ( Events::Title ) ]
                                                                                                                                      • Set Variable [ $r; Value:MBS( "Events.Item.SetTitle"; $item; Events::Title) ]
                                                                                                                                      • End If
                                                                                                                                      • If [ not IsEmpty ( Events::URL ) ]
                                                                                                                                      • Set Variable [ $r; Value:MBS( "Events.Item.SetURL"; $item; Events::URL) ]
                                                                                                                                      • End If
                                                                                                                                      • If [ not IsEmpty ( Events::Note ) ]
                                                                                                                                      • Set Variable [ $r; Value:MBS( "Events.Item.SetNotes"; $item; Events::Note) ]
                                                                                                                                      • End If
                                                                                                                                      • If [ not IsEmpty ( Events::Availability ) ]
                                                                                                                                      • Set Variable [ $r; Value:MBS( "Events.Event.SetAvailability"; $item; Events::Availability) ]
                                                                                                                                      • End If
                                                                                                                                      • If [ not IsEmpty ( Events::AllDay ) ]
                                                                                                                                      • Set Variable [ $r; Value:MBS( "Events.Event.SetAllDay"; $item; ( Events::AllDay = "All Day")) ]
                                                                                                                                      • End If
                                                                                                                                      • If [ not IsEmpty ( Events::Start Date ) ]
                                                                                                                                      • Set Variable [ $r; Value:MBS( "Events.Event.SetStartDate"; $item; Events::Start Date) ]
                                                                                                                                      • End If
                                                                                                                                      • If [ not IsEmpty ( Events::End Date ) ]
                                                                                                                                      • Set Variable [ $r; Value:MBS( "Events.Event.SetEndDate"; $item; Events::End Date) ]
                                                                                                                                      • End If
                                                                                                                                      • Set Variable [ $r; Value:MBS( "Events.SaveEvent"; $item ; "this"; 1 ) ]
                                                                                                                                      • If [ MBS("IsError") ]
                                                                                                                                      • Set Variable [ $error; Value:$r ]
                                                                                                                                      • Show Custom Dialog [ Title: "Failed to write record"; Message: $error; Default Button: “OK”, Commit: “Yes” ]
                                                                                                                                      • Exit Script [ Result: $error ]
                                                                                                                                      • Else
                                                                                                                                      • Set Field [ Events::CalendarItemIdentifier; MBS( "Events.Item.CalendarItemIdentifier"; $item ) ]
                                                                                                                                      • Set Field [ Events::CalendarItemExternalIdentifier; MBS( "Events.Item.CalendarItemExternalIdentifier"; $item ) ]
                                                                                                                                      • Commit Records/Requests [ No dialog ]
                                                                                                                                      • If [ Get(LastError) ≠ 0 ]
                                                                                                                                      • Set Variable [ $error; Value:Get ( LastExternalErrorDetail ) ]
                                                                                                                                      • Show Custom Dialog [ Title: "Failed to write record"; Message: $error; Default Button: “OK”, Commit: “Yes” ]
                                                                                                                                      • Exit Script [ Result: $error ]
                                                                                                                                      • Else
                                                                                                                                      • Exit Script [ Result: "OK" ]
                                                                                                                                      • End If
                                                                                                                                      • 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: [Sync new Event in FileMaker to Calendar]Next Script: [Sync event from Calendar to FileMaker]
                                                                                                                                            Script NameSync new Events from Calendar to FileMaker
                                                                                                                                            Run script with full access privilegesOff
                                                                                                                                            Include In MenuYes
                                                                                                                                            Layouts that use this script
                                                                                                                                              Scripts that use this script
                                                                                                                                              Script Definition
                                                                                                                                              Script Steps
                                                                                                                                              • #Find events not in FM
                                                                                                                                              • #if you copy script and adjust fields, please update SQL statement with your table name.
                                                                                                                                              • Go to Layout [ “Events” (Events) ]
                                                                                                                                              • # find current year and search for events in current year
                                                                                                                                              • Set Variable [ $now; Value:Get ( CurrentTimestamp ) ]
                                                                                                                                              • Set Variable [ $year; Value:Year ( $now ) ]
                                                                                                                                              • Set Variable [ $Events; Value:MBS("Events.Events"; Timestamp ( Date(1; 1; $year) ; Time(0;0;0) ); Timestamp ( Date(1; 1; $year+1) ; Time(0;0;0) ); Events::CalendarID) ]
                                                                                                                                              • If [ MBS("IsError") ]
                                                                                                                                              • Set Variable [ $error; Value:$Events ]
                                                                                                                                              • Show Custom Dialog [ Title: "Failed to write record"; Message: $error; Default Button: “OK”, Commit: “Yes” ]
                                                                                                                                              • Exit Script [ Result: $error ]
                                                                                                                                              • End If
                                                                                                                                              • # now loop to display
                                                                                                                                              • Set Variable [ $Count; Value:ValueCount ( $events ) ]
                                                                                                                                              • If [ $count > 0 ]
                                                                                                                                              • Set Variable [ $index; Value:1 ]
                                                                                                                                              • Loop
                                                                                                                                              • Set Variable [ $id; Value:GetValue ( $events ; $index ) ]
                                                                                                                                              • Set Variable [ $EventsCount; Value:MBS("FM.ExecuteFileSQL"; Get(FileName); "SELECT COUNT(*) FROM \"Events\" WHERE CalendarItemIdentifier=?"; 9; 13; $id) ]
                                                                                                                                              • If [ $EventsCount = 0 ]
                                                                                                                                              • #Event not found, so let's create a new one in FileMaker
                                                                                                                                              • New Record/Request
                                                                                                                                              • Set Field [ Events::Title; MBS("Events.Item.GetTitle"; $id) ]
                                                                                                                                              • Set Field [ Events::URL; MBS("Events.Item.GetURL"; $id) ]
                                                                                                                                              • Set Field [ Events::Note; MBS("Events.Item.GetNotes"; $id) ]
                                                                                                                                              • Set Field [ Events::Start Date; MBS("Events.Event.GetStartDate"; $id) ]
                                                                                                                                              • Set Field [ Events::End Date; MBS("Events.Event.GetEndDate"; $id) ]
                                                                                                                                              • Set Field [ Events::AllDay; If(MBS("Events.Event.GetAllDay"; $id); "All Day") ]
                                                                                                                                              • Set Field [ Events::Location; MBS("Events.Item.GetLocation"; $id) ]
                                                                                                                                              • Set Field [ Events::Availability; MBS("Events.Event.GetAvailability"; $id) ]
                                                                                                                                              • Set Field [ Events::CalendarItemIdentifier; MBS("Events.Item.CalendarItemIdentifier"; $id) ]
                                                                                                                                              • Set Field [ Events::CalendarItemExternalIdentifier; MBS("Events.Item.CalendarItemExternalIdentifier"; $id) ]
                                                                                                                                              • Commit Records/Requests [ No dialog ]
                                                                                                                                              • If [ Get(LastError) ≠ 0 ]
                                                                                                                                              • Set Variable [ $r; Value:Get ( LastExternalErrorDetail ) ]
                                                                                                                                              • Show Custom Dialog [ Title: "Failed to write record"; Message: $r; Default Button: “OK”, Commit: “Yes” ]
                                                                                                                                              • Exit Script [ Result: $r ]
                                                                                                                                              • End If
                                                                                                                                              • End If
                                                                                                                                              • Set Variable [ $index; Value:$index + 1 ]
                                                                                                                                              • Exit Loop If [ $index > $count ]
                                                                                                                                              • End Loop
                                                                                                                                              • End If
                                                                                                                                              • Exit Script [ Result: "OK" ]
                                                                                                                                              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: [Sync new Events from Calendar to FileMaker]Next Script: [Sync event from FileMaker to Calendar]
                                                                                                                                                    Script NameSync event from Calendar to FileMaker
                                                                                                                                                    Run script with full access privilegesOff
                                                                                                                                                    Include In MenuYes
                                                                                                                                                    Layouts that use this script
                                                                                                                                                      Scripts that use this script
                                                                                                                                                      Script Definition
                                                                                                                                                      Script Steps
                                                                                                                                                      • #Event in Calendar is newer
                                                                                                                                                      • Go to Layout [ “Events” (Events) ]
                                                                                                                                                      • Set Variable [ $item; Value:Events::CalendarItemIdentifier ]
                                                                                                                                                      • Set Variable [ $CalendarItemIdentifier; Value:MBS("Events.Item.CalendarItemIdentifier"; $item) ]
                                                                                                                                                      • If [ $CalendarItemIdentifier ≠ Events::CalendarItemIdentifier ]
                                                                                                                                                      • Set Field [ Events::CalendarItemIdentifier; $CalendarItemIdentifier ]
                                                                                                                                                      • End If
                                                                                                                                                      • Set Variable [ $CalendarItemExternalIdentifier; Value:MBS("Events.Item.CalendarItemExternalIdentifier"; $item) ]
                                                                                                                                                      • If [ $CalendarItemExternalIdentifier ≠ Events::CalendarItemExternalIdentifier ]
                                                                                                                                                      • Set Field [ Events::CalendarItemExternalIdentifier; $CalendarItemExternalIdentifier ]
                                                                                                                                                      • End If
                                                                                                                                                      • Set Variable [ $title; Value:MBS("Events.Item.GetTitle"; $item) ]
                                                                                                                                                      • If [ $title ≠ Events::Title ]
                                                                                                                                                      • Set Field [ Events::Title; $title ]
                                                                                                                                                      • End If
                                                                                                                                                      • Set Variable [ $URL; Value:MBS("Events.Item.GetURL"; $item) ]
                                                                                                                                                      • If [ $URL ≠ Events::URL ]
                                                                                                                                                      • Set Field [ Events::URL; $URL ]
                                                                                                                                                      • End If
                                                                                                                                                      • Set Variable [ $location; Value:MBS("Events.Item.GetLocation"; $item) ]
                                                                                                                                                      • If [ $location ≠ Events::Location ]
                                                                                                                                                      • Set Field [ Events::Location; $location ]
                                                                                                                                                      • End If
                                                                                                                                                      • Set Variable [ $Availability; Value:MBS("Events.Event.GetAvailability"; $item) ]
                                                                                                                                                      • If [ $Availability ≠ Events::Availability ]
                                                                                                                                                      • Set Field [ Events::Availability; $Availability ]
                                                                                                                                                      • End If
                                                                                                                                                      • Set Variable [ $AllDay; Value:If(MBS("Events.Event.GetAllDay"; $item); "All Day") ]
                                                                                                                                                      • If [ $AllDay ≠ Events::AllDay ]
                                                                                                                                                      • Set Field [ Events::AllDay; $AllDay ]
                                                                                                                                                      • End If
                                                                                                                                                      • Set Variable [ $StartDate; Value:MBS("Events.Event.GetStartDate"; $item) ]
                                                                                                                                                      • If [ $StartDate ≠ Events::Start Date ]
                                                                                                                                                      • Set Field [ Events::Start Date; $StartDate ]
                                                                                                                                                      • End If
                                                                                                                                                      • Set Variable [ $EndDate; Value:MBS("Events.Event.GetEndDate"; $item) ]
                                                                                                                                                      • If [ $EndDate ≠ Events::End Date ]
                                                                                                                                                      • Set Field [ Events::End Date; $EndDate ]
                                                                                                                                                      • End If
                                                                                                                                                      • If [ Get ( RecordOpenState ) = 2 ]
                                                                                                                                                      • #we got changes, so write
                                                                                                                                                      • Commit Records/Requests [ No dialog ]
                                                                                                                                                      • If [ Get(LastError) ≠ 0 ]
                                                                                                                                                      • Set Variable [ $error; Value:Get ( LastExternalErrorDetail ) ]
                                                                                                                                                      • Show Custom Dialog [ Title: "Failed to write record"; Message: $error; Default Button: “OK”, Commit: “Yes” ]
                                                                                                                                                      • Exit Script [ Result: $error ]
                                                                                                                                                      • End If
                                                                                                                                                      • End If
                                                                                                                                                      • Exit Script [ Result: "OK" ]
                                                                                                                                                      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: [Sync event from Calendar to FileMaker]Next Script: [DeleteEvent]
                                                                                                                                                            Script NameSync event from FileMaker to Calendar
                                                                                                                                                            Run script with full access privilegesOff
                                                                                                                                                            Include In MenuYes
                                                                                                                                                            Layouts that use this script
                                                                                                                                                              Scripts that use this script
                                                                                                                                                              Script Definition
                                                                                                                                                              Script Steps
                                                                                                                                                              • #Event in FileMaker is newer
                                                                                                                                                              • Go to Layout [ “Events” (Events) ]
                                                                                                                                                              • Set Variable [ $item; Value:Events::CalendarItemIdentifier ]
                                                                                                                                                              • Set Variable [ $changed; Value:0 ]
                                                                                                                                                              • Set Variable [ $location; Value:MBS("Events.Item.GetLocation"; $item) ]
                                                                                                                                                              • If [ Events::Location ≠ $location ]
                                                                                                                                                              • Set Variable [ $r; Value:MBS( "Events.Item.SetLocation"; $item; Events::Location) ]
                                                                                                                                                              • Set Variable [ $changed; Value:1 ]
                                                                                                                                                              • End If
                                                                                                                                                              • Set Variable [ $title; Value:MBS("Events.Item.GetTitle"; $item) ]
                                                                                                                                                              • If [ Events::Title ≠ $title ]
                                                                                                                                                              • Set Variable [ $r; Value:MBS( "Events.Item.SetTitle"; $item; Events::Title) ]
                                                                                                                                                              • Set Variable [ $changed; Value:1 ]
                                                                                                                                                              • End If
                                                                                                                                                              • Set Variable [ $URL; Value:MBS("Events.Item.GetURL"; $item) ]
                                                                                                                                                              • If [ Events::URL ≠ $URL ]
                                                                                                                                                              • Set Variable [ $r; Value:MBS( "Events.Item.SetURL"; $item; Events::URL) ]
                                                                                                                                                              • Set Variable [ $changed; Value:1 ]
                                                                                                                                                              • End If
                                                                                                                                                              • Set Variable [ $Note; Value:MBS("Events.Item.GetNotes"; $item) ]
                                                                                                                                                              • If [ Events::Note ≠ $Note ]
                                                                                                                                                              • Set Variable [ $r; Value:MBS( "Events.Item.SetNotes"; $item; Events::Note) ]
                                                                                                                                                              • Set Variable [ $changed; Value:1 ]
                                                                                                                                                              • End If
                                                                                                                                                              • Set Variable [ $AllDay; Value:If(MBS("Events.Event.GetAllDay"; $item); "All Day") ]
                                                                                                                                                              • If [ Events::AllDay ≠ $AllDay ]
                                                                                                                                                              • Set Variable [ $r; Value:MBS( "Events.Event.SetAllDay"; $item; ( Events::AllDay = "All Day")) ]
                                                                                                                                                              • Set Variable [ $changed; Value:1 ]
                                                                                                                                                              • End If
                                                                                                                                                              • Set Variable [ $StartDate; Value:MBS("Events.Event.GetStartDate"; $item) ]
                                                                                                                                                              • If [ Events::Start Date ≠ $StartDate ]
                                                                                                                                                              • Set Variable [ $r; Value:MBS( "Events.Event.SetStartDate"; $item; Events::Start Date) ]
                                                                                                                                                              • Set Variable [ $changed; Value:1 ]
                                                                                                                                                              • End If
                                                                                                                                                              • Set Variable [ $EndDate; Value:MBS("Events.Event.GetEndDate"; $item) ]
                                                                                                                                                              • If [ Events::End Date ≠ $EndDate ]
                                                                                                                                                              • Set Variable [ $r; Value:MBS( "Events.Event.SetEndDate"; $item; Events::End Date) ]
                                                                                                                                                              • Set Variable [ $changed; Value:1 ]
                                                                                                                                                              • End If
                                                                                                                                                              • Set Variable [ $Availability; Value:MBS("Events.Event.GetAvailability"; $item) ]
                                                                                                                                                              • If [ Events::Availability ≠ $Availability ]
                                                                                                                                                              • Set Variable [ $r; Value:MBS( "Events.Event.SetAvailability"; $item; Events::Availability) ]
                                                                                                                                                              • Set Variable [ $changed; Value:1 ]
                                                                                                                                                              • End If
                                                                                                                                                              • If [ $changed ]
                                                                                                                                                              • #we got changes, so write
                                                                                                                                                              • Set Variable [ $r; Value:MBS( "Events.SaveEvent"; $item ; "this"; 1 ) ]
                                                                                                                                                              • If [ MBS("IsError") ]
                                                                                                                                                              • Set Variable [ $error; Value:$r ]
                                                                                                                                                              • Show Custom Dialog [ Title: "Failed to save calendar item."; Message: $r; Default Button: “OK”, Commit: “Yes” ]
                                                                                                                                                              • Exit Script [ Result: $error ]
                                                                                                                                                              • End If
                                                                                                                                                              • End If
                                                                                                                                                              • Exit Script [ Result: "OK" ]
                                                                                                                                                              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: [Sync event from FileMaker to Calendar]
                                                                                                                                                                    Script NameDeleteEvent
                                                                                                                                                                    Run script with full access privilegesOff
                                                                                                                                                                    Include In MenuYes
                                                                                                                                                                    Layouts that use this script
                                                                                                                                                                    Scripts that use this script
                                                                                                                                                                      Script Definition
                                                                                                                                                                      Script Steps
                                                                                                                                                                      • Go to Layout [ “Events” (Events) ]
                                                                                                                                                                      • #delete in calendar if needed
                                                                                                                                                                      • If [ Length(Events::CalendarItemIdentifier) > 0 ]
                                                                                                                                                                      • Set Variable [ $r; Value:MBS( "Events.RemoveEvent"; Events::CalendarItemIdentifier; "this"; 1) ]
                                                                                                                                                                      • If [ MBS("IsError") ]
                                                                                                                                                                      • Show Custom Dialog [ Title: "Failed to delete event"; Message: $r; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                                                                                                                                      • Exit Script [ Result: $r ]
                                                                                                                                                                      • End If
                                                                                                                                                                      • End If
                                                                                                                                                                      • #delete in FileMaker here
                                                                                                                                                                      • Delete Record/Request [ No dialog ]
                                                                                                                                                                      • Set Variable [ $LastError; Value:Get(LastError) ]
                                                                                                                                                                      • If [ $LastError ≠ 0 ]
                                                                                                                                                                      • Show Custom Dialog [ Title: "Failed to delete event"; Message: $LastError; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                                                                                                                                      • Exit Script [ Result: "Error " & $LastError ]
                                                                                                                                                                      • End If
                                                                                                                                                                      • Exit Script [ Result: "OK" ]
                                                                                                                                                                      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: Events Sync

                                                                                                                                                                            Used functions:




                                                                                                                                                                            Links
                                                                                                                                                                            MBS Xojo blog