Events.Alarm.SetRelativeOffset
------------------------------

Sets a relative offset from an event start date to fire an alarm.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Events](component_Events.md) | [6.2](newinversion62.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ✅ Yes |

MBS( "Events.Alarm.SetRelativeOffset"; EKAlarm; TimeOffset ) 

**MBS**( **"Events.Alarm.SetRelativeOffset";** /\* Sets a relative offset from an event start date to fire an alarm. \*/  
**$EKAlarm**; /\* The reference to the alarm.e.g. $Alarm \*/   
**$TimeOffset**) /\* The relative time offset in seconds.e.g. -15\*60 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| EKAlarm | The reference to the alarm. | $Alarm |
| TimeOffset | The relative time offset in seconds. | -15\*60 |

### Result

Returns OK or error.

### Description

Sets a relative offset from an event start date to fire an alarm.  
Set this property to an appropriate negative value to establish an alarm trigger relative to the start date/time of an event. Setting this clears any existing date trigger.  
Value is in seconds.  
### Examples

Add an alaram with relative offset:

 Set Variable \[ $alarm ; Value: MBS ( "[Events.NewAlarm](EventsNewAlarm.md)" ) \]   
If \[ not IsEmpty(Test::AlarmSound ) \]   
 Set Variable \[ $r ; Value: MBS ( "[Events.Alarm.SetSound](EventsAlarmSetSound.md)"; $alarm ; Test::AlarmSound ) \]   
End If  
If \[ not IsEmpty(Test::AlarmLocationTitle ) \]   
 Set Variable \[ $l ; Value: MBS ( "[Events.StructuredLocation.NewLocationWithTitle](EventsStructuredLocationNewLocationWithTitle.md)"; Test::AlarmLocationTitle ) \]   
 Set Variable \[ $r ; Value: MBS ( "[Events.StructuredLocation.SetRadius](EventsStructuredLocationSetRadius.md)"; $l ; Test::AlarmLocationRadius ) \]   
 Set Variable \[ $r ; Value: MBS ( "[Events.StructuredLocation.SetGeoLocation](EventsStructuredLocationSetGeoLocation.md)"; $l ; Test::AlarmLocationGeoLat ; Test::AlarmLocationGeoLong ) \]   
 Set Variable \[ $r ; Value: MBS ( "[Events.Alarm.SetStructuredLocation](EventsAlarmSetStructuredLocation.md)"; $alarm ; $l ) \]   
 Set Variable \[ $r ; Value: MBS ( "[Events.Alarm.SetProximity](EventsAlarmSetProximity.md)"; $alarm ; Test::AlarmProximity ) \]   
End If  
\# e.g. AlarmRelativeOffsetSeconds contains -9 \* 60   
Set Variable \[ $r ; Value: MBS ( "Events.Alarm.SetRelativeOffset"; $alarm ; Evaluate( Test::AlarmRelativeOffsetSeconds ) ) \]   
Set Variable \[ $r ; Value: MBS ( "[Events.Item.AddAlarm](EventsItemAddAlarm.md)"; $item ; $alarm ) \]  
### See also

- [Events.Alarm.GetRelativeOffset](EventsAlarmGetRelativeOffset.md)
- [Events.Alarm.SetProximity](EventsAlarmSetProximity.md)
- [Events.Alarm.SetSound](EventsAlarmSetSound.md)
- [Events.Alarm.SetStructuredLocation](EventsAlarmSetStructuredLocation.md)
- [Events.Item.AddAlarm](EventsItemAddAlarm.md)
- [Events.NewAlarm](EventsNewAlarm.md)
- [Events.NewAlarmWithRelativeOffset](EventsNewAlarmWithRelativeOffset.md)
- [Events.StructuredLocation.NewLocationWithTitle](EventsStructuredLocationNewLocationWithTitle.md)
- [Events.StructuredLocation.SetGeoLocation](EventsStructuredLocationSetGeoLocation.md)
- [Events.StructuredLocation.SetRadius](EventsStructuredLocationSetRadius.md)

This function checks for a license.

Created 10th March 2016 , last changed 23th March 2020

  
[Events.Alarm.SetProximity](EventsAlarmSetProximity.md) - [Events.Alarm.SetSound](EventsAlarmSetSound.md)

[HTML Version](EventsAlarmSetRelativeOffset.shtml)