Skip to main content
Version: v1.0.0(int)

W039: Link contact to entity

Associates an existing contact with a customer, vendor, or other entity. Triggered from Customer Detail or Vendor Detail, "Add contact" with an existing contact.

Steps

  1. Verify the contact exists. Call Contacts.getContactById.

  2. Verify the entity exists. Route through the owning component (Customers.getCustomerById, Vendors.getById, etc.) based on entityType. The Contacts component will not resolve this on its own; it has no entity_id foreign key.

  3. Insert the link. Call Contacts.linkToEntity({ contactId, entityType, entityId, role, notes }).

Returns

The new link row.

Business rules

  • Entity resolution is L3's job. The Contacts component intentionally does not know how to resolve an entity_id back to its source table; the workflow routes per entityType.

Errors

  • NotFoundError. The contact or the entity was not found.