Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
10.1
10.2
10.3
10.4
10.5
11.0
11.1
11.2
11.3
11.4
Statistic
FMM
Blog
Saves the reminder.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Calendar | 3.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | ❌ No |
Parameter | Description | Example |
---|---|---|
reminderRef | The id of the reminder to query. | $reminderRef |
Returns OK or error.
Synchronize Todos with Reminders:
# Sync ToDos as Reminders from FileMaker to Mac Reminder app
# And sync back changes
#
# Please adjust to your fields and your special use case!
# You can optimize to only update fields on each side if changed
#
Go to Record/Request/Page [First]
Loop
# Check if we have an ID for this todo already
If [ToDos::SyncUID ≠ ""]
Set Variable [$c; Value:ToDos::SyncUID]
#Query last modification date
Set Variable [$completed; Value:MBS( "Calendar.Item.GetCompleted"; ToDos::SyncUID )]
Set Variable [$datum; Value:MBS( "Calendar.Item.GetDateStamp"; ToDos::SyncUID )]
If [MBS("isError")]
# Reminder was deleted, so we recreate
Set Field [ToDos::SyncUID; ""]
Commit Records/Requests [No dialog]
Else
#Update
If [$datum > ToDos::Last_Change]
#
#Reminder -> FM
#
#Sync note field
Set Variable [$notes; Value:MBS( "Calendar.Item.GetNotes"; ToDos::SyncUID )]
If [ToDos::To Do Main Text ≠ $notes]
#Special: If note starts with # then move number to duration field
If [Left ( Trim ( $notes ); 1) = "#"]
Set Variable [$duration; Value:GetAsNumber ( LeftWords ( $notes ; 1 ))]
Set Field [ToDos::To Do Completion Time in Minutes; $duration]
Commit Records/Requests [No dialog]
Else
Set Field [ToDos::To Do Main Text; $notes]
Commit Records/Requests [No dialog]
End If
End If
#Sync title if changed
Set Variable [$title; Value:MBS( "Calendar.Item.GetTitle"; ToDos::SyncUID )]
If [ToDos::To Do Headline ≠ $title]
Set Field [ToDos::To Do Headline; $title]
Commit Records/Requests [No dialog]
End If
#Sync completed flag if changed
If [$completed=1]
If [ToDos::flag To Do Completed ≠ "X"]
Set Field [ToDos::flag To Do Completed; "X"]
Commit Records/Requests [No dialog]
End If
Else If [$completed=0]
If [ToDos::flag To Do Completed ≠ ""]
Set Field [ToDos::flag To Do Completed; ""]
Commit Records/Requests [No dialog]
End If
End If
Else
#
# FM -> Reminder
#
# overwrite all values
Set Variable [$r; Value:MBS("Calendar.Item.SetTitle"; $c; ToDos::To Do Headline)]
Set Variable [$r; Value:MBS("Calendar.Item.SetNotes"; $c; ToDos::To Do Main Text)]
Set Variable [$r; Value:MBS("Calendar.Item.SetDueDate"; $c; ToDos::To Do Deadline )]
If [ToDos::flag To Do Completed = "X"]
Set Variable [$r; Value:MBS("Calendar.Item.SetCompleted"; $c; 1)]
End If
If [ToDos::flag To Do Completed = ""]
Set Variable [$r; Value:MBS("Calendar.Item.SetCompleted"; $c; 0)]
End If
If [ToDos::To Do Priority="1 Jetzt"]
Set Variable [$r; Value:MBS("Calendar.Item.SetPriority"; $c;1 )]
End If
If [ToDos::To Do Priority="2 Sofort"]
Set Variable [$r; Value:MBS("Calendar.Item.SetPriority"; $c;5 )]
End If
If [ToDos::To Do Priority="4 Hat Zeit"]
Set Variable [$r; Value:MBS("Calendar.Item.SetPriority"; $c;9 )]
End If
Set Variable [$r; Value:MBS("Calendar.SaveReminder"; $c )]
End If
End If
End If
If [ToDos::SyncUID = ""]
# Create new reminder
#
# Which calendar? (Reminder List)
Set Variable [$CalenderName; Value:""]
If [ToDos::To Do By="PF"]
Set Variable [$CalenderName; Value:"ToDo PF"]
Else If [ToDos::To Do By = "GK"]
Set Variable [$CalenderName; Value:"ToDo GK"]
End If
If [$CalenderName ≠ ""]
Set Variable [$c; Value:MBS("Calendar.NewReminder")]
Set Variable [$r; Value:MBS("Calendar.Item.SetTitle"; $c; ToDos::To Do Headline)]
Set Variable [$r; Value:MBS("Calendar.Item.SetNotes"; $c; ToDos::To Do Main Text)]
Set Variable [$r; Value:MBS("Calendar.Item.SetCalendar"; $c;$CalenderName)]
Set Variable [$r; Value:MBS("Calendar.Item.SetDueDate"; $c; ToDos::To Do Deadline )]
If [ToDos::To Do Priority="1 Jetzt"]
Set Variable [$r; Value:MBS("Calendar.Item.SetPriority"; $c;1 )]
End If
If [ToDos::To Do Priority="2 Sofort"]
Set Variable [$r; Value:MBS("Calendar.Item.SetPriority"; $c;5 )]
End If
If [ToDos::To Do Priority="4 Hat Zeit"]
Set Variable [$r; Value:MBS("Calendar.Item.SetPriority"; $c;9 )]
End If
If [ToDos::flag To Do Completed = "X"]
Set Variable [$r; Value:MBS("Calendar.Item.SetCompleted"; $c; 1)]
End If
If [ToDos::flag To Do Completed = ""]
Set Variable [$r; Value:MBS("Calendar.Item.SetCompleted"; $c; 0)]
End If
Set Variable [$r; Value:MBS("Calendar.SaveReminder"; $c )]
#store id for update later
Set Field [ToDos::SyncUID; MBS("Calendar.Item.GetUID"; $c)]
Commit Records/Requests [No dialog]
End If
End If
Go to Record/Request/Page [Next; Exit after last]
End Loop
Created 18th August 2014, last changed 22nd September 2016
Calendar.SaveEvent - Calendar.SelectEvent
Feedback: Report problem or ask question.