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

# \_setCode

Sets the Serial Number of the Asset.

### Parameters

#### id

The ID of the Asset.

### Example

```
FM_api('Asset_setCode', ['id' => '123', 'value' => '221100']);
```

### Result

#### On Success

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

#### On Failure

If the Asset ID is not given:

```
{'error':'no ID provided'}
```

If the value is not given:

```
{'error':'no val provided'}
```

If the Asset is not found:

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