Preserve document provenance when CRM records merge
3 November 2026
When a CRM consolidation changes record ownership while a document attachment job is in flight, system integrations must hold the attachment job rather than writing to a merged record. Preserving document provenance requires recording the original identity, confirming explicit merge authority, and verifying the newly approved target record before writing the final link. In automated document processing—such as attaching a PDF to a CRM deal after a retry—if a targeted CRM record transitions to a merged status, local integration logic should place the job in a held state (such as HELD_RECORD_STATE). The hold gives the owner time to verify the surviving record without losing the original request. Mapping test results · Record mapping
Why in-flight CRM consolidation compromises document provenance
Document generation workflows in enterprise CRM environments often operate asynchronously. A trigger event—such as a deal closure, quote generation, or retry operation—queues a document rendering process. However, during the interval between job dispatch and final link creation, operational teams may execute CRM account consolidations or deal merges to clean up duplicate records.
When record ownership changes while a document job is in flight, proceeding with the original record identifier creates a severe provenance failure. The resulting PDF attachment may link to a deprecated record, become unsearchable, or misrepresent historical ownership. Keep the original record identity and queue-time mapping. An integration that simply follows a redirect can preserve the PDF bytes yet lose the business context in which the job was authorised. Mapping test results · Record mapping
To preserve full document provenance during a merge, integrations must capture three core metadata elements prior to link execution:
- Original identity: The exact record identifier, account portal, and object type specified when the document creation job was initially queued.
- Merge authority: The documented system authorisation or user approval that sanctioned the CRM consolidation.
- Approved target identity: The verified destination CRM record identifier designated to hold active ownership following the merge. Mapping test results · Record mapping
Evaluating synthetic merge test evidence and guard conditions
The synthetic mapping and local results separate the behaviour tested from the recovery process a buyer still needs to qualify. The Python run recorded six matching expected outcomes and one model link across all six controls. It made zero network calls. An authenticated CRM integration and real file upload were not run. Mapping test results · Record mapping
The synthetic baseline payload record-mapping.json defines an incoming attachment request:
- Account / Portal ID:
SYN-PORTAL-01 - Object Type:
deal - Record ID:
SYN-D100 - Source Case:
SYN-CASE-77 - Document ID / Revision:
SYN-DOC-09(Revision 1) - Mapping Revision:
3 - Operation:
attach-approved-copy-v1Mapping test results · Record mapping
In the test scenario labelled merged_record, the current mapping lookup confirms that while account, object type, record ID, source case, and mapping revision match the incoming request, the target CRM record state has transitioned to MERGED. Mapping test results · Record mapping
Rather than attempting an unverified link creation or throwing an unhandled exception, the local guard condition returns the result state HELD_RECORD_STATE. The test suite explicitly notes its scope limitations: these guard conditions establish local model behaviour only, with no actual CRM permissions, merge redirects, API responses, or cross-object behaviours tested. Mapping test results · Record mapping
Worked decision record and operational ledger
| Provenance field | Observed in the local merged-record control | Evidence required for an actual release |
|---|---|---|
| Original request | Portal SYN-PORTAL-01, deal SYN-D100, case SYN-CASE-77, document SYN-DOC-09 revision 1. | Preserve those queue-time identities even if the job is approved for another destination. |
| Current state | The queried record carried state MERGED. The model returned HELD_RECORD_STATE. | Obtain the authoritative merge event, source and surviving record, effective time and who authorised it. |
| Permitted new target | No surviving record ID or authorisation to redirect is supplied in this control. | Confirm the target's portal, object, case, current state and receiver permissions. Document who accepted the new mapping. |
| Final link | The held case contains no successful attachment result. The single link in the summary belongs to the wider control set. | Before resuming, search for an existing link under the same approved operation. After a write, read back the exact destination and document revision. |
Mapping test results · Record mapping
Resume without erasing the original request
If the authorised mapping is confirmed, record the old and new identities as separate fields and link the new attempt to the held request. Do not change the historical request in place or silently substitute a guessed record ID. Choose a job identity appropriate to the approved target and operation so that an earlier attempt cannot be mistaken for a successful delivery to the new destination. Before committing, recheck that the mapping has not changed again. A revision check or conditional write can hold the job if it has. Mapping test results · Record mapping
If the system cannot supply reliable evidence of the merge or the surviving record spans a different account, keep the job held. The owner can obtain an authoritative mapping, cancel that job or authorise a new one through the controlled process. The old document, job and any prior link remain discoverable. No live permission or redirect behaviour was tested in the local run. Mapping test results · Record mapping
Part of the Attach a PDF to the right CRM record after a retry guide.
Published by Arke Technologies (Pty) Ltd, Johannesburg. Drafted with NotebookLM. Source checks and editing by Kairos (Codex).
