> ## 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.

# ErpExternalKey table

> The external (ERP-facing) key related to a synchronized record / connection

## ErpExternalKey Table (423)

The external (ERP-facing) key related to a synchronized record / connection

## Fields

| Name                      | Description                                                                                                                 | Type                                          | Nullable |
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- | :------: |
| erpexternalkey\_id        | Primary key                                                                                                                 | PK                                            |    No    |
| ErpInternalKeyId          | Link to the internal key and thus the original table/record in SuperOffice that is being synchronized                       | FK [ErpInternalKey](./erpinternalkey.mdx)     |    No    |
| ErpConnectionId           | Link to the Erp connection the key relates to                                                                               | FK [ErpConnection](./erpconnection.mdx)       |    No    |
| ErpKey                    | The primary key from the ERP system                                                                                         | String(254)                                   |    No    |
| ActorType                 | The actor type within the ERP system of this synchronized record                                                            | Enum [ErpActorType](./enums/erpactortype.mdx) |    No    |
| MostRecentTimestamp       | Datetime, transaction number or other identification of the point in time of the most-recently seen actor in the ERP system | String(254)                                   |    No    |
| registered                | Registered when                                                                                                             | UtcDateTime                                   |    No    |
| registered\_associate\_id | Registered by whom                                                                                                          | FK [associate](./associate.mdx)               |    No    |
| updated                   | Last updated when                                                                                                           | UtcDateTime                                   |    No    |
| updated\_associate\_id    | Last updated by whom                                                                                                        | FK [associate](./associate.mdx)               |    No    |
| updatedCount              | Number of updates made to this record                                                                                       | UShort                                        |    No    |

<img src="https://mintcdn.com/superofficeas/zNQa3AO19PFK63SB/media/loc/en/database/tables/ErpExternalKey.png?fit=max&auto=format&n=zNQa3AO19PFK63SB&q=85&s=1fb9fd7a1416f35ad764a8c540173cfd" alt="ErpExternalKey table relationship diagram" width="920" height="850" data-path="media/loc/en/database/tables/ErpExternalKey.png" />

## Indexes

| Fields                             | Types                 | Description |
| ---------------------------------- | --------------------- | ----------- |
| ErpConnectionId, ErpInternalKeyId  | FK, FK                | Unique      |
| ErpConnectionId, ActorType, ErpKey | FK, Enum, String(254) | Unique      |
| ErpInternalKeyId                   | FK                    | Index       |

## Relationships

| Table                              | Description                                                                          |
| ---------------------------------- | ------------------------------------------------------------------------------------ |
| [associate](./associate)           | Employees, resources and other users - except for External persons                   |
| [ErpConnection](./erpconnection)   | One connection to an ERP connector, specifying Client and other required information |
| [ErpInternalKey](./erpinternalkey) | The internal (superoffice-facing) key related to a synchronized record               |
| [ErpSyncLog](./erpsynclog)         | Record all field changes done by the Erp Sync                                        |

## Replication Flags

* None

## Security Flags

* No access control via user's Role.


## Related topics

- [ErpInternalKey table](/en/database/tables/erpinternalkey.md)
- [ErpSyncLog table](/en/database/tables/erpsynclog.md)
- [ErpConnection table](/en/database/tables/erpconnection.md)
- [Enum values for ErpActorType](/en/database/tables/enums/erpactortype.md)
- [SuperOffice.WebApi.Data.ErpActorType](/en/api/reference/webapi/SuperOffice.WebApi.Data.ErpActorType.md)
- [contact table](/en/database/tables/contact.md)
