Plan the business relationship, not just the link
A document link represents a business relationship: this document belongs to this business transaction. A URL is merely a technical route to access it. Treating the two as equivalent makes the integration dependent on server names, user interfaces and URL structures. The design should therefore start by identifying the objects involved: for example, the supplier invoice in the ERP system, the archived invoice document in the DMS and any supporting attachments.
A one-to-one relationship is not always appropriate. A business transaction may have several documents, and a document may be relevant to several transactions. Define which relationships are permitted and what role each document plays. Distinguishing between the original invoice, an attachment and an internal approval note, for example, prevents a technical search from opening an arbitrary result as the authoritative supporting document.
Separate identities from search attributes
Invoice numbers, supplier names and posting dates are useful for searching, but are not automatically suitable as technical keys. They may occur more than once, be corrected or appear in different formats. A reliable mapping therefore uses a stable ERP object ID and a stable DMS document ID. If these are unique only within a tenant or system instance, that context must explicitly form part of the key. When test systems are copied from production data, the environments must also remain clearly distinguishable.
Store the mapping so that it can be queried independently of any particular user interface. This can be done in a system of record or in an integration table. The access link is then generated from the identity or resolved through a supported access mechanism. You must also decide whether the ERP transaction refers to a logical document or to a specific version. Where specific evidence is required, a link must not silently point to content that has subsequently changed.
- Specify keys clearly: source system, environment, tenant and object ID.
- Record the document's role and, where applicable, the authoritative version in the mapping.
- Establish whether IDs are retained during export, restoration and migration.
- If IDs change, provide a verifiable mapping between old and new identities.
Define data ownership for every synchronised field
An integration becomes inconsistent when both systems can independently change the same metadata. For every transferred field, it should therefore be clear which system is the authoritative source. For example, the ERP system might own the posting status and supplier account assignment, while the DMS manages document-related information and its own processing statuses. What matters is not this particular division of responsibilities, but that it reflects the actual processes and is technically enforced.
Also define which changes may affect existing mappings. A corrected cost centre usually changes only metadata; a reversal or a new posting may require an additional relationship. A historical document should not simply be reassigned to a new transaction if this removes the original context. Conflicts need a defined resolution process: automatic overwriting by the authoritative source, rejection or a review by the relevant business team. A blanket 'last change wins' rule is often unsuitable for these decisions.
Retries must be safe – even after partial success
A typical failure occurs when the DMS successfully stores a document, but a connection failure prevents the response from reaching the integration service. If the same request is executed again, it must not create an uncontrolled duplicate. Processing should therefore be idempotent: repeating the same uniquely identified business request must not create additional documents or relationships. This can be achieved through a unique request identifier, an atomically enforced uniqueness constraint or a corresponding interface function. Simply searching for existing documents beforehand does not reliably protect against concurrent access.
Documented intermediate states are equally important. 'Document created, ERP link still pending' is different from 'Transfer not started'. After a restart, the integration service must be able to determine which step was actually completed. Transient technical errors should be retried; business-level errors, such as an unknown tenant, should instead be referred for investigation. Even when events arrive late, an old status must not overwrite a newer one.
Use reconciliation to uncover silent errors
An error-free interface response does not prove that all expected relationships exist. Requests may be lost before transfer, documents may be mapped incorrectly, or individual transactions may be excluded from export. Supplement ongoing processing with reconciliation. This compares the document relationships expected under the business process with the mappings that actually exist and checks whether the referenced objects can be accessed. Normal processing delays must be taken into account so that transactions still in progress are not immediately flagged as errors.
The results should appear in an actionable error list, not just a technical log. Each case should identify the transaction, document, error category, latest processing status and responsible role. Only cases with an unambiguous resolution should be repaired automatically. Similar invoice numbers or identical file names are not enough to support a reliable reassignment. Corrections confirmed by the relevant business team must remain traceable; sensitive document content generally should not be included in the logs for this purpose.
- Missing relationships: an ERP transaction that requires a supporting document has no mapping after the agreed processing period has elapsed.
- Broken references: a stored document or transaction ID can no longer be resolved.
- Invalid multiple mappings: the existing relationships conflict with the agreed business model.
- Inconsistent metadata: synchronised fields do not match the designated authoritative source.
Treat permissions and system changes as separate test cases
A stored link must not grant additional access rights. When a document is opened, access must be checked in the intended user context; a technical integration account with broad permissions must not serve as a general route to document access. Test separately whether a document exists and whether a particular person is allowed to view it. Titles, search results and error messages can also reveal confidential information. Lack of access is also not sufficient reason to automatically delete an existing mapping as broken.
Migrations and restorations require separate verification. Even if both systems have been successfully restored from a technical perspective, different backup times can leave relationships inconsistent. Before automatic processing resumes, establish which requests have already been executed and which still need to be processed. When changing systems, references should be transferred using a documented mapping table and then checked – not rediscovered through approximate file-name matching.