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

Events.SaveReminder

Saves changes to a reminder.

Component Version macOS Windows Linux Server iOS SDK
Events 6.2 ✅ Yes ❌ No ❌ No ❌ No ✅ Yes
MBS( "Events.SaveReminder"; EKReminder { ; Commit } )   More

Parameters

Parameter Description Example Flags
EKReminder The reference to the reminder. $Reminder
Commit Whether to commit.
Pass 1 to commit or 0 to not commit.
Default is 1.
Pass 0 to batch changes together and commit with Events.Commit later.
1 Optional

Result

Returns OK or error.

Description

Saves changes to a reminder.
This function attempts to save the reminder to the event store database. It returns OK if successful and error otherwise.

After a reminder is successfully saved, its fields are updated to the latest values in the database.

You may still need to call Events.Commit later.

Examples

Create Reminder:

Set Variable [$reminder; Value:MBS( "Events.NewReminder" )]
Set Variable [$calendar; Value:Events Create Reminder::Calendar]
If [IsEmpty(Events Create Reminder::Calendar)]
    Set Variable [$calendar; Value:MBS( "Events.defaultCalendarForNewReminders" )]
End If
Set Variable [$r; Value:MBS( "Events.Item.SetCalendar"; $reminder; $calendar )]
Set Variable [$r; Value:MBS( "Events.Item.SetLocation"; $reminder; Events Create Reminder::Location )]
Set Variable [$r; Value:MBS( "Events.Item.SetTitle"; $reminder; Events Create Reminder::Title )]
Set Variable [$r; Value:MBS( "Events.Item.SetURL"; $reminder; Events Create Reminder::URL )]
Set Variable [$r; Value:MBS( "Events.Item.SetNotes"; $reminder; Events Create Reminder::Notes )]
If [IsEmpty(Events Create Reminder::TimeZone)]
    #we don't set it
Else
    Set Variable [$r; Value:MBS( "Events.Item.SetTimeZone"; $reminder; Events Create Reminder::TimeZone )]
End If
Set Variable [$r; Value:MBS( "Events.Item.SetNotes"; $reminder; Events Create Reminder::Notes )]
Set Variable [$r; Value:MBS( "Events.Reminder.SetPriority"; $reminder; Events Create Reminder::Priority )]
If [not IsEmpty(Events Create Reminder::StartDate)]
    Set Variable [$r; Value:MBS( "Events.Reminder.SetStartDate"; $reminder; Events Create Reminder::StartDate )]
End If
If [not IsEmpty(Events Create Reminder::DueDate)]
    Set Variable [$r; Value:MBS( "Events.Reminder.SetDueDate"; $reminder; Events Create Reminder::DueDate )]
End If
If [not IsEmpty(Events Create Reminder::AlarmSound) or not IsEmpty(Events Create Reminder::AlarmLocationTitle) or not IsEmpty(Events Create Reminder::AlarmLocationGeoLat)]
    Set Variable [$alarm; Value:MBS( "Events.NewAlarm" )]
    If [not IsEmpty(Events Create Reminder::AlarmSound)]
        Set Variable [$r; Value:MBS( "Events.Alarm.SetSound"; $alarm; Events Create Reminder::AlarmSound )]
    End If
    If [not IsEmpty(Events Create Reminder::AlarmLocationTitle)]
        Set Variable [$l; Value:MBS( "Events.StructuredLocation.NewLocationWithTitle"; Events Create Reminder::AlarmLocationTitle )]
        Set Variable [$r; Value:MBS( "Events.StructuredLocation.SetRadius"; $l; Events Create Reminder::AlarmLocationRadius )]
        Set Variable [$r; Value:MBS( "Events.StructuredLocation.SetGeoLocation"; $l; Events Create Reminder::AlarmLocationGeoLat; Events Create Reminder::AlarmLocationGeoLong )]
        Set Variable [$r; Value:MBS( "Events.Alarm.SetStructuredLocation"; $alarm; $l)]
        Set Variable [$r; Value:MBS( "Events.Alarm.SetProximity"; $alarm; Events Create Reminder::AlarmProximity )]
    End If
    Set Variable [$r; Value:MBS( "Events.Item.AddAlarm"; $reminder; $alarm )]
End If
Set Variable [$r; Value:MBS( "Events.SaveReminder"; $reminder ;1 )]
Show Custom Dialog ["Saved Reminder"; $r]

See also

Example Databases

This function checks for a license.

Created 10th March 2016, last changed 17th March 2021


Events.SaveEvent - Events.SelectEvent