# \_setCustom

Sets the value of a custom element in a Contract.

### Parameters

#### id

The ID of the Contract.

#### name

The name of the element.

#### value

The value of the element. Can take a single value or an array of values. For example, an array of values could be used to denote hours and minutes for a Time element.

### Example

For a single value:

```
FM_api('Contract_setCustom', [
	'id' => '1',
	'name'=> 'Lorem',
	'value' => 'Ipsum'
]);
```

For an array of values:

```
FM_api('Contract_setCustom', [
	'id' => '1',
	'name'=> 'Time',
	'value' => ['4', '20']
]);
```

### Result

#### On Success

```
{'ok':1}
```

#### On Failure

If the User is not logged in:

```
{'error':'not logged in'}
```

If the ID of the Contract is not given or is less than 1:

```
{'error':'invalid parameter: id'}
```

If the element name is not given:

```
{'error':'invalid parameter: name'}
```

If the element value is not given:

```
{'error':'invalid parameter: value'}
```

If the specified Contract does not exist:

```
{'error':'contract does not exist'}
```


---

# 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://docs.fieldmotion.com/fieldmotion-api-docs/contract/_setcustom.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.
