# About the Quality-LIMS Connection

Organizations using both a Quality Vault and a LIMS Vault on the same domain can use a standard Vault to Vault connection. The Quality-LIMS Connection transfers _Batch_, _Related Batch_, _Material_, _Related Material_, _Product_, _Product Family_, _Product Variant_, _Product Marketed_, _Organization_, _Asset Family_, and _Asset_ records across Vaults and automates the creation, versioning, and updating of CrossLink documents and document fields. Streamlining object record and document creation reduces duplicate data and allows Vault documents to have a single source of truth within an organization.

## How the Quality-LIMS Connection Works

The Quality-LIMS Operations Connection creates new records, updates existing records, and creates <a class="external-link " href="https://quality.veevavault.help/en/lr/23143" target="_blank" rel="noopener">CrossLink<i class="fa fa-external-link" aria-hidden="true"></i></a> documents across Vaults in the following situations:

  * When a document enters its _Steady_ state in the source Vault, Vault creates or versions a CrossLink document in the target Vault and populates fields. Any previous steady state versions are also created in the target Vault.
  * When a document enters its _Obsolete_ state in the source Vault, Vault causes the existing CrossLink document in the target Vault to become obsolete.
  * When a document enters its _Superseded_ state in the source Vault, Vault causes the existing CrossLink document in the target Vault to become superseded.
  * When a user updates fields on documents in the source Vault, Vault updates the crosslinked document in the target Vault.
  * When an object record is created in the source Vault, Vault creates the object record in the target Vault, if it doesn't already exist.
  * When an object record is edited and saved in the source Vault, Vault updates the object record in the target Vault.
  * When an object record moves to a different lifecycle state in the source Vault, Vault triggers a state change for the object record in the target Vault.
  * When an object record is deleted in the source Vault, Vault deletes the object record in the target Vault.

## About Record Creation & Update

Vault creates new records in their lifecycles' _Starting_ states. When creating a record through the connection, Vault also populates the _Link_ (`link__sys`) field on the target record with the source record's _Global ID_ (`global_id__sys`). These fields let Vault know which records to update in the target Vault when data is updated in the source Vault.

## About Document Creation & Update

Vault creates new CrossLink documents in the steady state defined in the target Vault's document lifecycle of a given document type. If the document's type has multiple lifecycles, Vault applies the first lifecycle available. The connection creates CrossLink documents using the Specific Document Version binding rule. See details about [source binding rules][1] below.

The Quality-LIMS Connection creates, up-versions, and syncs metadata for documents in the target Vault that are configured to transfer between Vault applications:

  * When a source document enters its _Steady_ state, the connection creates a CrossLink in the target Vault in the _Steady_ state of the target's Document Type defined on the document lifecycle. Vault also applies any entry actions configured on that lifecycle state, for example, setting the version number to a major version.
  * If a connection-created CrossLink exists on the target Vault and a new version of the source document is created and moved to a steady state, the connection up-versions the Target CrossLink and creates a new CrossLink version.
  * When the fields on a _Steady_ state source document are modified in the source Vault, Vault updates those fields on the CrossLink document in the target Vault.
  * If the connection has never run, Vault only transfers the latest _Steady_ state version of the document.
  * Document versions created in the target Vault are set by the target Vault and bound to the versions from which they were created in the source Vault.
  * When enabled by an Admin, Vault transfers any _Superseded_ versions of a document created since the last time the connection ran.
    * If there are both _Steady_ state and _Superseded_ versions of the source document in the source Vault that have not been transferred to the target Vault since the last time the connection ran, Vault transfers all of these document versions.

### About Source Binding Rules {#source-binding}

If a CrossLink document does not already exist in the target Vault, Vault creates the CrossLink document and binds it to the current document version in the source Vault. Vault will then update the CrossLink document only if a user in the source Vault specifically edits the version of the source document that is bound.

All CrossLink documents created via the Quality-LIMS Connection have the _Source Binding Rule_ set to [_Specific Document Version_](/en/lr/23145/#crosslinksourcebinding).

  [1]: #source-binding