> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ExtraTable

> A class to access extra tables and create, edit and delete entries.

A class to access extra tables and create, edit and delete entries.

## Constructors

### ExtraTable()

```crmscript theme={null}
ExtraTable
```

Initializes a new instance of the ExtraTable class.

## Methods

## delete()

Deletes the loaded object.

```crmscript theme={null}
Void delete()
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

## delete(Bool)

Deletes the loaded object.

```crmscript theme={null}
Void delete(Bool signalWebhook)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

## getValue(String)

Returns the value of the given field for the currently loaded entry.

```crmscript theme={null}
String getValue(String field)
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The value of the given field for the currently loaded entry.

**Example:**

```crmscript theme={null}
ExtraTable ex = getExtraTable("y_myTable");
Bool b = ex.load(2);
print(b.toString());
print(ex.getValue("x_table"));
```

## getValues()

Returns all the fields and values of the extraTable row as a Map.

```crmscript theme={null}
Map getValues()
```

**Returns:** [CRMScript.Native.Map](CRMScript.Native.Map) - All the fields and values of the extraTable row.

## load(Integer)

Loads the extra table entry with the given ID.

```crmscript theme={null}
Bool load(Integer id)
```

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - True if the entry was found and loaded; otherwise, false.

**Example:**

```crmscript theme={null}
ExtraTable ex = getExtraTable("y_myTable");
Bool b = ex.load(2);
print(b.toString());
```

## loadFromAgentAndKey(Integer,String)

Used for integrating data from external systems.

```crmscript theme={null}
Bool loadFromAgentAndKey(Integer agent, String key)
```

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - True if the entry was found and loaded; otherwise, false.

## save()

Creates a new or updates an existing extra-table entry. If ID is set, the table will be updated. Otherwise, a new extra-table entry will be created.

```crmscript theme={null}
Integer save()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The ID of the newly saved object.

<Note>
  Use save(Bool) to signal that the entry should be reloaded after the save.
</Note>

## save(Bool)

Creates a new or updates an existing extra-table entry. If ID is set, the table will be updated. Otherwise, a new extra-table entry will be created.

```crmscript theme={null}
Integer save(Bool reload)
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The ID of the newly saved object.

## save(Bool,Bool)

Creates a new or updates an existing extra-table entry. If ID is set, the table will be updated. Otherwise, a new extra-table entry will be created.

```crmscript theme={null}
Integer save(Bool reload, Bool signalWebhook)
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The ID of the newly saved object.

## setValue(String,String)

Sets the value of a given field if it exists.

```crmscript theme={null}
Void setValue(String field, String value)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
ExtraTable ex = getExtraTable("y_myTable");
Bool b = ex.load(2);
print(b.toString());
ex.setValue("name", "Test");
print(ex.getValue("x_table"));
```


## Related topics

- [ExtraTable events](/en/automation/webhook/reference/extratable-events.md)
- [extra_menus table](/en/database/tables/extra-menus.md)
- [Void](/en/automation/crmscript/reference/CRMScript.Global.Void.md)
- [Delete Hierarchy From Path](/en/api/reference/restful/agent/list_agent/delete-hierarchy-from-path.md)
- [SuperOffice.WebApi.Data.Domain](/en/api/reference/webapi/SuperOffice.WebApi.Data.Domain.md)
- [Enum Domain](/en/automation/crmscript/reference/CRMScript.NetServer.Domain.md)
