Prevent a PDF being attached to the wrong case

3 November 2026

Folders and paper records arranged in an open filing drawer.
Illustrative photograph. Cropped and resized. Photo: “Archived files of research materials from the creation of the Dictionary of Old English.jpg” — Alarichall / Wikimedia Commons. · CC BY-SA 4.0

When an incoming case matches two similarly named customer records in a Customer Relationship Management (CRM) system, automated document linking must execute an immediate stop condition to halt processing before any file is attached. Identity validation logic compares target record details against an approved business mapping, rejecting mismatched record identifiers and preventing attachments from landing on unverified customer files. Mapping test results · Record mapping

Stop conditions and evidence requirements for ambiguous customer records

Automating PDF document attachments creates operational risks if an incoming case matches two similarly named customer records. If automated workflow logic relies solely on name matching or unverified metadata, a document risks being linked to the wrong customer record. To prevent incorrect attachments, integration pipelines must enforce a pre-attachment stop condition that halts job execution whenever target identity verification fails. Mapping test results · Record mapping

A robust stop condition for ambiguous customer records relies on three core requirements:

  1. Defined Halt Condition: The integration payload—containing parameters such as target account (account), record type (object_type), target record ID (record_id), source case ID (source_case), document ID (document_id), document revision (document_revision), and mapping revision (mapping_revision)—is validated against the current active business mapping. If an incoming request targets an unapproved record ID (for instance, requesting target SYN-D101 when the active mapping specifies SYN-D100), the system triggers an immediate stop condition, logging a state of REJECTED_IDENTITY and identifying record_id as the mismatched field.
  2. Owner-Provided Evidence: Overriding or resolving a halted attachment job requires verified evidence from the business record owner. The owner must confirm the authoritative target record ID, verify that the customer account is active, and validate the mapping revision. Importantly, matching a recorded file checksum confirms only document data integrity; it does not prove intended record ownership, correct customer entitlement, or current access permissions.
  3. Evidence of what happened. In the local control the mismatched ID returned REJECTED_IDENTITY with no link result. The entire test made zero network calls. That cannot establish the contents of a live customer record. For an authorised pilot, inspect the links on both candidate records before and after the attempt, using the same document ID and revision. Correlate those observations with the job and write audit. If the integration account cannot see a destination, label that part unverified and obtain a read-back from its owner.

Mapping test results · Record mapping

Worked decision record and validation ledger

System administrators and integration engineers can maintain an operational decision ledger to evaluate document attachment requests against active record mappings.

The ledger uses synthetic identifiers, including portal account SYN-PORTAL-01, source case SYN-CASE-77, document SYN-DOC-09, and record identifiers SYN-D100 and SYN-D101 from the local control. Mapping test results · Record mapping

The decision ledger below summarizes six synthetic mapping cases evaluated locally in Python 3.12.14, where all six cases passed local validation logic and produced one created model link. Note that external authenticated API tests (hubspot_authenticated_test) and actual file upload operations (real_file_upload) are explicitly recorded as NOT_RUN. Mapping test results · Record mapping

Target AccountObject TypeTarget Record IDSource Case IDMapping RevisionEvaluated StateMismatched FieldNext Step Owner & Action to Close
SYN-PORTAL-01dealSYN-D100SYN-CASE-773CREATED_MODEL_LINKNoneSystem: Model link created successfully; job completed.
SYN-PORTAL-01dealSYN-D100SYN-CASE-773RECONCILED_EXISTING_LINKNoneSystem: Reconciled existing model link without duplicating records.
SYN-PORTAL-01dealSYN-D101SYN-CASE-773REJECTED_IDENTITYrecord_idBusiness owner: the candidate name matched, but target ID SYN-D101 mismatched approved SYN-D100. Owner must confirm target ID and update mapping.
SYN-PORTAL-02dealSYN-D100SYN-CASE-773REJECTED_IDENTITYaccountIntegration Lead: Correct target portal account configuration.
SYN-PORTAL-01dealSYN-D100SYN-CASE-774HELD_STALE_MAPPINGmapping_revisionAdmin: Reconcile the request and the current mapping before authorising a new attempt.
SYN-PORTAL-01dealSYN-D100SYN-CASE-773 (Merged)HELD_RECORD_STATErecord_stateAdmin: Re-map target record following CRM account consolidation.

Mapping test results · Record mapping

The highlighted row shows what happens when an incoming case matches two similarly named customer records. Although the incoming payload specifies source case SYN-CASE-77 and document revision 1, requesting target record SYN-D101 causes the validation engine to reject the transaction because current active mapping specifies record SYN-D100. The system flags record_id as the mismatched field and halts in a REJECTED_IDENTITY state. Closing this issue requires the business owner to review both customer records, determine whether SYN-D101 or SYN-D100 is the correct target, and authorize an updated mapping revision if the target has changed. Mapping test results · Record mapping

Prove the outcome after a retry

Take the same pre-write readings for a delayed job. Keep the original request and the current authoritative mapping when they differ. If the business owner confirms that the original target was correct, plan a controlled retry after the integration reconciles the conflict; do not loosen the identity check. If the owner names a different target, retain that decision and give the revised operation its own traceable identity. The test suite also records separate stale-mapping and merged-record holds, so an active state from an earlier check cannot substitute for current evidence. Mapping test results · Record mapping

For each attempt, record the target account and object, the two candidate IDs, the document revision, the reject or hold reason and the receiving records inspected. If an earlier uncertain request might already have written a link, investigate it before another write. Close the exception only when the owner can identify the authorised case, inspect its resulting association and account for the absence or removal of the same document on the wrong case. The synthetic model did not exercise live permissions, redirects, uploads or CRM responses. 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).