# \_updateMeta

Controls accessibility of the Customer Portal for a specified Customer, or can be used to set the Account Sage Number of a Customer instead.

### Parameters

#### id

The ID of the Customer.

#### meta

The type of data being modified. (Works with "customer\_portal" and "account\_sage")

#### val

An integer value, if meta is set to "customer\_portal", this sets the accessibility of the Customer Portal for the Customer:\
0 => Can visit all 3 pages in the Customer Portal. (Assets, Quote and Invoice)\
1 => Cannot visit Assets page but can visit Quote and Invoice pages.\
2 => Cannot visit Quote page but can visit Assets and Invoice pages.\
3 => Can only visit Invoice page.\
4 => Cannot visit Invoice page but can visit Assets and Quote pages.\
5 => Can only visit Quote page.\
6 => Can only visit Assets page.\
7 => Cannot visit any of the 3 pages.

If meta is set to "account\_sage" however, this instead sets the Account Sage Number of the Customer.

### Examples

With "meta" set to "customer\_portal":

```
FM_api('Customer_updateMeta',[
  'id' => '712686',
  'meta' => 'customer_portal',
  'val' => '5'
]);
```

(The Customer with an ID of 712686 will only be able to access the Quote page.)

With "meta" set to "account\_sage":

```
FM_api('Customer_updateMeta',[
  'id' => '712686',
  'meta' => 'account_sage',
  'val' => '123467'
]);
```

(Sets the Account sage number of the Customer with ID 712686 to 123467.)

### Results

#### On Success

```
{"ok":1}
```

#### On Failure

If the "id" parameter is missing or given a value less than 1:

```
{"error":"missing or invalid parameter: id"}
```

If the "meta" parameter is missing or empty after being trimmed:

```
{"error":"missing or invalid parameter: meta"}
```

If the "val" parameter is not set:

```
{"error":"missing or invalid parameter: val"}
```


---

# 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/customer/_updatemeta.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.
