# Table EcENTITY

entity data (item, change order, purchase request, etc)

| **field**          | **data type**         | **description**                                                                                                                                              |
| ------------------ | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **id**             | bigint not null PK    | record number                                                                                                                                                |
| **bulk\_id**       | int not null          | <p>bulk number – unique number for a set of rows that are referenced by EcASSOC ent\_id\_parent/ent\_id\_child fields (BOM, Change order items,</p><p>…)</p> |
| **ent\_class\_id** | nvarchar 10 not null  | entity type (FILE; ITEM; CUSTENT; CO; FLDR)                                                                                                                  |
| **guid**           | nvarchar 36           | entity guid (only for ent\_class\_id=CUSTENT)                                                                                                                |
| **name**           | nvarchar 100 not null | entity name (folder name, CustEnt name, item number, CO number)                                                                                              |
| **master\_id**     | bigint                | Vault MasterId – remains the same during the whole Vault entity life                                                                                         |
| **iter\_id**       | bigint                | iteration number – changes each time the entity is updated/changed                                                                                           |
| **revision**       | nvarchar 12           | entity revision                                                                                                                                              |
| **version**        | int                   | entity version                                                                                                                                               |
| **modified**       | datetime              | last time the entity was changed in a Vault/ERP                                                                                                              |
| **category**       | nvarchar 60           | entity category (or routing name for CO)                                                                                                                     |
| **lfcycst\_id**    | int                   | entity lifecycle state id                                                                                                                                    |
| **lfcycst\_name**  | nvarchar 60           | entity lifecycle state display name                                                                                                                          |
| **base\_qty**      | float                 | BOM component base quantity                                                                                                                                  |
| **base\_uom**      | nvarchar 10           | for ent\_class\_id = ITEM: unit of measure (Vault UOM abbreviation)                                                                                          |

|                   | default = ‘’                                       | for ent\_class\_id = FLDR: ‘LIBRARY’ for Library Folder Type                                                                                                                                                                                                                                          |
| ----------------- | -------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **requested\_by** | nvarchar 60                                        | communication requested by user name                                                                                                                                                                                                                                                                  |
| **comm\_dir**     | <p>int not null</p><p><del>bit not null</del></p>  | <p>target system specification: ERP = 0, Vault = 1, FLC = 10</p><p><del>transfer direction: Vault to DI = 0, DI to Vault = 1</del> changed 2021-02</p>                                                                                                                                                |
| **comm\_status**  | smallint not null default = -1                     | <p>transfer status:</p><p>PreparingData = -1, Pending = 0,</p><p>Stage1Finished = 1, Stage2Finished = 2, Success = 7, Ignore=8, Error = 9,</p><p>SuccessReportRequest = 70, SuccessReported = 71,</p><p>ErrorReportRequest = 90, ErrorReported = 91,</p><p>MockMode = -7; PendingPublication = -2</p> |
| **thumbnail**     | varbinary                                          | thumbnail (export from Vault; only for FILE or ITEM)                                                                                                                                                                                                                                                  |
| **created**       | <p>datetime not null</p><p>default = GetDate()</p> | time of creation of the transfer request                                                                                                                                                                                                                                                              |
| **processed1**    | datetime                                           | stage 1 finished timestamp                                                                                                                                                                                                                                                                            |
| **processed2**    | datetime                                           | stage 2 finished timestamp                                                                                                                                                                                                                                                                            |

Remarks:

* entity type is fully specified by two fields: “ent\_class\_id” + “guid”

however “guid” field is used only when ent\_class\_id=’CUSTENT’

* each EcENTITY table record is considered as a data transfer request
* records are grouped by “bulk\_id”,

bulk is data describing one transfer batch, e.g. : BOM structure, CO with linked items, …

bulk is data having relations that must be respected during processing

* bulk\_id value:
  * ERP Connector creates/generates only positive bulk\_id value by incrementing the MAX existing value
  * In case external system (ERP) is not able to reliably create/generate such number, it can use its own unique negative numbers;

in other words: external system uses its own negative bulk\_id values and guarantees its uniqueness

* MockMode = for testing purposes only; data should be ignored by the target system
* field length can be modified
* comm\_dir field data type can be BIT
