# Start Service

Service is a Global Action Set that you can run as a background process.

Action available for the following operating systems:

![](/files/-MGIiDGuNcrVFP-DbUma)

### Parameters

* **Service** *\<numeric> -* Select a number for a service. Can be Dynamic or 1-10.
* **Global Action Set** - Select a Global Action Set to run as a Service.
* **Start Type** *\<numeric> -* Select how do you want to Start the Service:
  * 1 - *Immediate* - The ActionSet will start to execute immediatly.
  * 2 - *With Delay* - The ActionSet will start to execute after the specified delay time.
  * 3 - *Periodic* - Similar to a Timer, the ActionSet will execute with the specified interval.
* **Cancel execution if running** *\<numeric>*
  * 1 - Yes (Used to cancel a service if it is running while reactivating the service with a call to this action)
  * 2 - No
* **Delay (ms)** *\<numeric> -* Specified the delay or interval depending on the **Start Type**.

{% hint style="info" %}
In Win32 (includes Windows CE an Mobile) services are not supported. Calling this, will cause a service to be emulated by the current process, by running the ActionSet in a background thread. But if the project closes, the services will also stop working.
{% endhint %}

{% hint style="warning" %}
Services require Android 5.0 or later.
{% endhint %}

{% hint style="info" %}

* It is important to be aware that service executions have high limitations imposed differently by the different O.S.
* Periodic services are not ment to be executed with high frequency, they are ment to be executed for example every 1 or 2 hours.
* On Win10, the Periodic service delay cannot be lower than 15 min, and the service code will have a time limit of about 30 seconds to run.
* On iOS, only immediate services are available, and it will have a time limit of around 3 minutes after the app is suspended. It can be useful if you have some code that you want to get executed even if the user exits your App.
* On Android, the system will start to delay the Periodic timer, specially if you specified a high frequency.
* On Android you can increase the service priority and ensure it will not be likely to get suspended by using Android Foreground Services. Check **SetServiceNotification** action for more information.
  {% endhint %}

{% hint style="danger" %}
VERY IMPORTANT: Do not use **User Interface** code in services. Do not open Forms, Show Message Boxes, Popups, etc. If you do, the behavior is undetermined and can cause the application to crash.
{% endhint %}

{% hint style="info" %}
Services are supposed to execute tasks in the Background. If you need to inform the application of something, you can use **PostAppNotification** action. Database and global variables are shared with the service also.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.sysdevmobile.com/kalipso5/developing/form/actions/actions-description/group-others/start-service.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
