Calendar.SaveReminder
---------------------

Saves the reminder.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Calendar](component_Calendar.md) | [3.4](newinversion34.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ❌ No |

### Deprecated

This function was [deprecated](deprecated.md).

MBS( "Calendar.SaveReminder"; reminderRef ) 

**MBS**( **"Calendar.SaveReminder";** /\* Saves the reminder. \*/  
**$reminderRef**) /\* The id of the reminder to query. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| reminderRef | The id of the reminder to query. | $reminderRef |

### Result

Returns OK or error.

### Description

Saves the reminder.  
### Examples

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](CalendarItemGetCompleted.md)"; ToDos::SyncUID )\]  
 Set Variable \[$datum ; Value:MBS ( "[Calendar.Item.GetDateStamp](CalendarItemGetDateStamp.md)"; ToDos::SyncUID )\]  
 If \[MBS ("isError")\]  
 # Reminder was deleted, so we recreate  
 Set Field \[ToDos::SyncUID ; ""\]  
 Commit Records/Requests \[No dialog\]  
 Else  
 #Update  
 If \[$datum &gt; ToDos::Last\_Change \]  
 #  
 #Reminder -&gt; FM  
 #  
 #Sync note field  
 Set Variable \[$notes ; Value:MBS ( "[Calendar.Item.GetNotes](CalendarItemGetNotes.md)"; 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](CalendarItemGetTitle.md)"; 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 -&gt; Reminder  
 #  
 # overwrite all values  
 Set Variable \[$r ; Value:MBS ("[Calendar.Item.SetTitle](CalendarItemSetTitle.md)"; $c ; ToDos::To Do Headline)\]  
 Set Variable \[$r ; Value:MBS ("[Calendar.Item.SetNotes](CalendarItemSetNotes.md)"; $c ; ToDos::To Do Main Text)\]  
 Set Variable \[$r ; Value:MBS ("[Calendar.Item.SetDueDate](CalendarItemSetDueDate.md)"; $c ; ToDos::To Do Deadline )\]  
 If \[ToDos::flag To Do Completed = "X"\]  
 Set Variable \[$r ; Value:MBS ("[Calendar.Item.SetCompleted](CalendarItemSetCompleted.md)"; $c ; 1)\]  
 End If  
 If \[ToDos::flag To Do Completed = ""\]  
 Set Variable \[$r ; Value:MBS ("[Calendar.Item.SetCompleted](CalendarItemSetCompleted.md)"; $c ; 0)\]  
 End If  
 If \[ToDos::To Do Priority="1 Jetzt"\]  
 Set Variable \[$r ; Value:MBS ("[Calendar.Item.SetPriority](CalendarItemSetPriority.md)"; $c ;1 )\]  
 End If  
 If \[ToDos::To Do Priority="2 Sofort"\]  
 Set Variable \[$r ; Value:MBS ("[Calendar.Item.SetPriority](CalendarItemSetPriority.md)"; $c ;5 )\]  
 End If  
 If \[ToDos::To Do Priority="4 Hat Zeit"\]  
 Set Variable \[$r ; Value:MBS ("[Calendar.Item.SetPriority](CalendarItemSetPriority.md)"; $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 \[$CalendarName ; Value:""\]  
 If \[ToDos::To Do By="PF"\]  
 Set Variable \[$CalendarName ; Value:"ToDo PF"\]  
 Else If \[ToDos::To Do By = "GK"\]  
 Set Variable \[$CalendarName ; Value:"ToDo GK"\]  
 End If  
 If \[$CalendarName ≠ ""\]  
 Set Variable \[$c ; Value:MBS ("[Calendar.NewReminder](CalendarNewReminder.md)")\]  
 Set Variable \[$r ; Value:MBS ("[Calendar.Item.SetTitle](CalendarItemSetTitle.md)"; $c ; ToDos::To Do Headline)\]  
 Set Variable \[$r ; Value:MBS ("[Calendar.Item.SetNotes](CalendarItemSetNotes.md)"; $c ; ToDos::To Do Main Text)\]  
 Set Variable \[$r ; Value:MBS ("[Calendar.Item.SetCalendar](CalendarItemSetCalendar.md)"; $c ;$CalendarName )\]  
 Set Variable \[$r ; Value:MBS ("[Calendar.Item.SetDueDate](CalendarItemSetDueDate.md)"; $c ; ToDos::To Do Deadline )\]  
 If \[ToDos::To Do Priority="1 Jetzt"\]  
 Set Variable \[$r ; Value:MBS ("[Calendar.Item.SetPriority](CalendarItemSetPriority.md)"; $c ;1 )\]  
 End If  
 If \[ToDos::To Do Priority="2 Sofort"\]  
 Set Variable \[$r ; Value:MBS ("[Calendar.Item.SetPriority](CalendarItemSetPriority.md)"; $c ;5 )\]  
 End If  
 If \[ToDos::To Do Priority="4 Hat Zeit"\]  
 Set Variable \[$r ; Value:MBS ("[Calendar.Item.SetPriority](CalendarItemSetPriority.md)"; $c ;9 )\]  
 End If  
 If \[ToDos::flag To Do Completed = "X"\]  
 Set Variable \[$r ; Value:MBS ("[Calendar.Item.SetCompleted](CalendarItemSetCompleted.md)"; $c ; 1)\]  
 End If  
 If \[ToDos::flag To Do Completed = ""\]  
 Set Variable \[$r ; Value:MBS ("[Calendar.Item.SetCompleted](CalendarItemSetCompleted.md)"; $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](CalendarItemGetUID.md)"; $c )\]  
 Commit Records/Requests \[No dialog\]  
 End If  
 End If  
 Go to Record/Request/Page \[Next; Exit after last\]  
End Loop  
### See also

- [Calendar.Item.GetDateStamp](CalendarItemGetDateStamp.md)
- [Calendar.Item.GetNotes](CalendarItemGetNotes.md)
- [Calendar.Item.GetTitle](CalendarItemGetTitle.md)
- [Calendar.Item.SetCompleted](CalendarItemSetCompleted.md)
- [Calendar.Item.SetDueDate](CalendarItemSetDueDate.md)
- [Calendar.Item.SetNotes](CalendarItemSetNotes.md)
- [Calendar.NewReminder](CalendarNewReminder.md)
- [Calendar.RemoveReminder](CalendarRemoveReminder.md)
- [Calendar.SaveCalendar](CalendarSaveCalendar.md)
- [Calendar.SaveEvent](CalendarSaveEvent.md)

### Example Databases

- [Mac and iOS/Events/Calendar/Reminders](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20and%20iOS/Events/Calendar/Reminders.shtml#2ScriptAnchor_)

### Blog Entries

- [Todo/Reminder Synchronization for FileMaker on Mac using MBS Plugin](https://www.mbsplugins.de/archive/2016-09-22/TodoReminder_Synchronization_f/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 10th October 2023

  
[Calendar.SaveEvent](CalendarSaveEvent.md) - [Calendar.SelectEvent](CalendarSelectEvent.md)

[HTML Version](CalendarSaveReminder.shtml)