Schedule.SetAutoRelease
-----------------------

Sets if scheduled item is removed from list of schedules automatically after execution.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Schedule](component_Schedule.md) | [5.2](newinversion52.md) | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ✅ Yes |

MBS( "Schedule.SetAutoRelease"; ScheduleRef; Value ) 

**MBS**( **"Schedule.SetAutoRelease";** /\* Sets if scheduled item is removed from list of schedules automatically after execution. \*/  
**$ScheduleRef**; /\* The reference for a scheduled script call or sql query as returned by Schedule.StartScript\* functions or Schedule.ExecuteSQL\* functions.e.g. $ref \*/   
**$Value**) /\* The new setting. 1 to free schedule item after it run (and has no repeating), 0 to not free it.e.g. 1 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| ScheduleRef | The reference for a scheduled script call or sql query as returned by Schedule.StartScript\* functions or Schedule.ExecuteSQL\* functions. | $ref |
| Value | The new setting. 1 to free schedule item after it run (and has no repeating), 0 to not free it. | 1 |

### Result

Returns OK or error.

### Description

Sets if scheduled item is removed from list of schedules automatically after execution.  
### Examples

Set schedule to be destroyed after last execution:

 MBS ( "Schedule.SetAutoRelease"; $ScheduleRef ; 1 )  
Set schedule to be not destroyed after last execution:

 MBS ( "Schedule.SetAutoRelease"; $ScheduleRef ; 0 )  
### See also

- [Schedule.GetAutoRelease](ScheduleGetAutoRelease.md)
- [Schedule.GetEvaluateResult](ScheduleGetEvaluateResult.md)
- [Schedule.GetSQLResult](ScheduleGetSQLResult.md)

This function checks for a license.

Created 21st May 2015 , last changed 27th May 2015

  
[Schedule.ReleaseAll](ScheduleReleaseAll.md) - [Schedule.SetEnabled](ScheduleSetEnabled.md)

[HTML Version](ScheduleSetAutoRelease.shtml)