> For the complete documentation index, see [llms.txt](https://docs.agilecase.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.agilecase.com/developer-documentation/developer-documentation.md).

# Getting Started

The ways you can extend AgileCase with your own code, and which one to reach for.

AgileCase can be extended with your own JavaScript, so it can do things the standard settings do not cover. There are four extension points, and they are quite different from one another: two run inside the browser while a user works, one runs on the server when a case is saved, and one moves data between AgileCase and other systems.

This page introduces all four at a high level so you can decide which fits your problem. Each has its own guide with the detail.

{% hint style="info" %}
These guides assume JavaScript experience. If you can describe what you need but would rather not build it, get in touch at <sales@agilecase.com> and we can quote for writing it for you.
{% endhint %}

## The four extension points

<table data-view="cards"><thead><tr><th>Area</th><th>What it is for</th><th data-card-target data-type="content-ref">Target</th></tr></thead><tbody><tr><td><strong>Case Scripting</strong></td><td>Run your own script when a case is opened or when it is saved. Automate actions, validate input, and reshape the case screen.</td><td><a href="/developer-documentation/case-scripting.md">Case Scripting</a></td></tr><tr><td><strong>Custom Form Scripting</strong></td><td>Run a script inside a single custom field tab, using a JavaScript label field. Calculations, conditional formatting, dynamic fields.</td><td><a href="/developer-documentation/custom-form-scripting.md">Custom Form Scripting</a></td></tr><tr><td><strong>Webhooks</strong></td><td>Send case data out to another system when something happens, or let another system push data into AgileCase.</td><td><a href="/developer-documentation/webhooks.md">Webhooks</a></td></tr><tr><td><strong>Case Data API</strong></td><td>Read any value from a case as JSON. This is how scripts running in the browser get at case data.</td><td><a href="/developer-documentation/case-data-api.md">Case Data API</a></td></tr></tbody></table>

## Where your code runs

This is the most useful distinction to hold on to, because it determines what your code can reach.

<table><thead><tr><th width="230">Extension point</th><th width="130">Runs</th><th>What it can use</th></tr></thead><tbody><tr><td><strong>JavaScript label fields</strong></td><td>In the browser</td><td>The page it sits in, jQuery, and the Case Data API. Scoped to its own tab.</td></tr><tr><td><strong>On load scripts</strong></td><td>In the browser</td><td>The whole case screen, jQuery, and the Case Data API.</td></tr><tr><td><strong>On save scripts</strong></td><td>On the server</td><td>The <code>Service</code> object, which can send email, add tasks, update fields and call webhooks.</td></tr></tbody></table>

Because on load scripts and JavaScript label fields run in the browser, they read case data over HTTP through the [Case Data API](/developer-documentation/case-data-api.md) and they cannot write anything back. Because on save scripts run on the server, they do not touch the page at all; they queue up actions through the [Service object](/developer-documentation/case-scripting/on-save-scripts/script-api-reference.md) which AgileCase carries out as part of saving.

## Choosing an approach

* Changing what the user sees on one tab, such as a calculated total or a colour that depends on a value, is a job for a [JavaScript label field](/developer-documentation/custom-form-scripting.md).
* Changing the case screen as a whole, such as surfacing a value buried in a custom field group or warning about a stale case, is a job for an [on load script](/developer-documentation/case-scripting/on-load-scripts.md).
* Making something happen as a consequence of saving, such as sending an email, creating a task or updating another field, is a job for an [on save script](/developer-documentation/case-scripting/on-save-scripts.md).
* Telling another system about a change, or accepting data from one, is a job for a [webhook](/developer-documentation/webhooks.md).

## Before you write a script

Some of what people reach for scripting to do is already available in ordinary settings, and configuration is easier to live with than code:

* [Calculated Fields](/developer-documentation/case-scripting/calculated-fields.md) derive a value on the server, every time that value is needed.
* [Editing Tab Visibility](/administrator-documentation/case-type-settings/editing-tab-visibility.md) and [Core Case Data Visibility](/administrator-documentation/case-type-settings/core-case-data-visibility.md) control what users see.
* [Creating a Case Plan](/administrator-documentation/case-type-settings/creating-a-case-plan.md) drives cases through their stages automatically.

It is worth ruling these out before taking on the maintenance of a script.
