Introducing a new way to review your PRs.

Read the announcement

frappe / crm

Fully featured, open source CRM

View on GitHub

24 documents · Updated Nov 23, 2026

docs / contacts-and-organizations

Contacts and organizations

Contacts and organizations are the CRM records that describe the people and companies involved in customer work. Contacts hold personal identity and reach details. Organizations hold company context. Together they give leads, deals, and daily CRM work a stable view of who a team is working with.

Record model

Contact records

The Contact record represents a person. It provides a name, organization name, address, gender, and other person details. Email addresses and phone numbers can have multiple values, with one primary value used by related CRM work. The CRM extends the standard contact view with list columns and record actions for this workflow. References: crm/…/contact.py• L5-48, crm/install.py• L172-175, frontend/…/useContactFields.ts• L109-140

Contact creation starts with a quick-entry form. The form checks required fields and basic email and mobile formats before it sends the record to the server. It turns the first email and mobile values into the contact's primary communication values. References: frontend/…/ContactModal.vue• L28-45, frontend/…/ContactModal.vue• L83-165

Organization records

The CRM Organization record represents a company. Its name is unique and also serves as the record identity. The name can be renamed, so dependent contact and deal associations must be reviewed when it changes. Company context includes a website, logo, employee range, industry, territory, address, social links, and revenue in a chosen currency. A new organization can use its website to prefill fields, and the server can start a best-effort enrichment task after creation. References: crm/…/crm_organization.json• L26-124, crm/…/crm_organization.py• L31-47, frontend/…/OrganizationModal.vue• L95-136

Organization currency is kept with an exchange rate to the CRM base currency. The rate is set when the currency changes or when the record has no rate. It does not change automatically after that point. References: crm/…/crm_organization.py• L31-47, crm/…/crm_organization.json• L77-93

Record associations

A contact points to a company through company_name, which stores the organization name used by the CRM. The organization page finds its people by matching that value. This makes the organization name the key shared by the two record experiences, even though the contact field is not a formal link field. References: frontend/…/Organization.vue• L421-440, frontend/…/Contact.vue• L80-85, crm/…/contact.py• L27-48

Users can link an existing contact from an organization's Contacts tab or create a new contact with that organization already set. Both actions update the same shared organization name, so the organization page becomes a practical place to maintain the people linked to a company. References: frontend/…/Organization.vue• L27-51, frontend/…/Organization.vue• L213-218, frontend/…/Organization.vue• L469-503

The same organization can appear on deals through the deal's organization link. The organization page therefore acts as a company view across both people and opportunities. References: crm/…/crm_deal.json• L86-93, frontend/…/Organization.vue• L446-488

Deals use the CRM Contacts child record to associate one or more contacts with an opportunity. Each association identifies a contact and can mark one association as primary. The primary person's email and phone are copied to the deal so deal actions have one clear contact point. References: crm/…/crm_contacts.json• L18-77, crm/…/crm_deal.json• L138-170, crm/…/crm_deal.py• L127-162

When a contact changes, the server refreshes the email and mobile values on deals where that contact is primary. This keeps the deal snapshot aligned with the contact record while preserving the deal's single-primary-contact rule. References: crm/…/contact.py• L7-44, crm/…/crm_deal.py• L140-162

Record creation from deal data

Deal creation can reuse an existing organization or contact. If no matching record exists, the server creates the organization from company data and the contact from person and communication data. Matching by organization name, email, or mobile helps avoid duplicate records during conversion flows. References: crm/…/crm_deal.py• L410-472, crm/…/crm_deal.py• L475-497

The main association flow moves from person and company input to a deal with both records attached. This diagram shows the relationship rather than the internal save steps.

flowchart LR
    Person[Contact] -->|company_name| Company[CRM Organization]
    Company -->|organization| Deal[CRM Deal]
    Person -->|CRM Contacts association| Deal
    Person -->|primary email and phone| Deal

References: crm/…/crm_deal.py• L410-497 crm/…/crm_deal.json• L86-93

Server API surface

Organization session data

The organization session API returns the organizations available to a CRM session. The client uses this shared data to resolve company names and logos while it renders contact and deal rows. Access requires one of the allowed CRM roles. References: crm/…/session.py• L4-19, crm/…/session.py• L160-171, frontend/…/organizations.js• L6-31

Contact communication APIs

The contact API supports the small changes that users make to a person's communication data after creation. It can add an email or phone, set one value as primary, update a value, remove a value, search contacts by email, and return the deals linked to a contact. Read and write checks protect the contact and its related data. References: crm/…/contact.py• L47-154, frontend/…/useContactFields.ts• L43-101

The linked-deal response gives the contact view the organization, deal value, status, owner, and current contact details needed for its opportunity tab. The API checks contact read permission and returns only deals the user can read. References: crm/…/contact.py• L47-72, frontend/…/Contact.vue• L340-350

Generic document operations

The client uses the common Frappe document operations for create, save, rename, and delete actions. The record-specific APIs handle communication changes and linked-deal lookup. This split lets configurable field layouts control ordinary fields while focused APIs protect multi-value contact data. References: frontend/…/ContactModal.vue• L123-165, frontend/…/OrganizationModal.vue• L139-176, frontend/…/Organization.vue• L363-384, frontend/…/useContactFields.ts• L73-100

Client experiences

List experiences

The Contacts and Organizations pages provide searchable, filterable list views with saved view controls, paging, row selection, and bulk actions. A row opens the matching detail route. Contact rows show a person's identity and company. Organization rows show company identity and core company values. References: frontend/…/Contacts.vue• L19-59, frontend/…/Organizations.vue• L19-59, frontend/…/ContactsListView.vue• L1-18, frontend/…/OrganizationsListView.vue• L1-16

Both list experiences use configurable fields from the server. The page formats values for display and the list component supplies common filtering, selection, and load-more behavior. References: frontend/…/Contacts.vue• L85-159, frontend/…/Organizations.vue• L80-155

Contact detail experience

The contact detail view combines editable contact fields with a Deals tab. Users can manage the profile image, address, email values, phone values, and primary selections from the detail surface. They can also call the primary mobile number when telephony is enabled. References: frontend/…/Contact.vue• L17-156, frontend/…/Contact.vue• L240-344, frontend/…/useContactFields.ts• L143-180

The contact view can start a new deal for the person. It passes an existing organization as a deal link when one matches the contact's company name; otherwise it passes the company name as input for the deal flow to resolve. References: frontend/…/Contact.vue• L15-20, frontend/…/Contact.vue• L299-315

The mobile contact view keeps the same two ideas but presents them as Details and Deals tabs. Routing selects the desktop or mobile detail page for the same contact record. References: frontend/…/MobileContact.vue• L13-157, frontend/…/router.js• L76-86

Organization detail experience

The organization detail view combines company fields with Deals and Contacts tabs. Users can update the logo, edit the address, open the company website, and enrich the record from its website. The related tabs use the organization name to show its people and deals. References: frontend/…/Organization.vue• L23-170, frontend/…/Organization.vue• L399-488

The Contacts tab can add an existing contact to the organization or open contact creation with the company already selected. The Deals tab starts a deal with the organization selected, which keeps new work attached to the company view. References: frontend/…/Organization.vue• L21-51, frontend/…/Organization.vue• L213-223, frontend/…/Organization.vue• L490-503

The mobile organization view keeps the same company, people, and opportunity relationships in a compact tab layout. The shared route selects it when the client is in a mobile view. References: frontend/…/MobileOrganization.vue• L13-150, frontend/…/router.js• L88-98

Configurable record forms

Create forms and detail panels are driven by field layouts. Managers can open the field layout editor from the create dialogs, while ordinary users work with the configured fields and record permissions. Address fields open a shared address form instead of storing free-form address text in the contact or organization. References: crm/install.py• L162-215, frontend/…/ContactModal.vue• L180-223, frontend/…/OrganizationModal.vue• L179-229

Contacts and organizations are shared inputs to the wider CRM record model. Read CRM record management for the common record and view model. Read Lead and deal lifecycle for conversion and opportunity progress. Read Record productivity workflows for the work, notes, communication, and activity surfaces attached to records.

Change checklist

When these files or sections are changed, remember to consider these:

  • If the contact's company field or organization naming changes, review both organization-side filters and contact-row company display. The association depends on the same name value.
  • If contact email or phone storage changes, review primary-value sync to deals and the add, edit, delete, and set-primary API paths together.
  • If the CRM Contacts child record changes, review deal primary-contact rules and the contact linked-deals lookup.
  • If organization fields or names change, review list identity, detail routing, deal links, contact filters, and organization session data.
  • If quick-entry or side-panel layouts change, review the matching desktop and mobile detail views and any address or enrichment actions attached to those fields.

Important failure modes

TriggerConsequenceGuard
A contact uses an organization name that does not match an existing organization nameThe contact does not appear in that organization's Contacts tabKeep the shared organization name consistent. Review both sides when changing naming rules.
More than one deal contact is marked primaryDeal validation rejects the saveThe deal model allows only one primary contact. Use its primary-contact actions to replace the current primary.
The primary contact's email or mobile changes outside the contact update pathA deal can show stale primary contact detailsKeep contact updates on the supported Contact record and communication API paths.
A user lacks the needed CRM or document permissionSession data or contact-linked deal data is deniedUse an allowed CRM role and enforce read or write permission before calling record APIs.
An organization name is renamed without updating dependent referencesContact matching or links that use the old name can stop resolvingTreat organization names as association keys and review dependent records during a rename.

Key files

FileWhy to read it
crm/…/crm_organization.jsonDefines the company record and its business-facing fields.
crm/…/contact.pyShows the CRM list shape for person records.
crm/…/crm_contacts.jsonDefines the contact-to-deal association and primary marker.
crm/…/contact.pyDefines contact communication and linked-deal server operations.
crm/…/crm_deal.pyExplains primary contact behavior and record reuse during deal creation.
frontend/…/Contact.vueShows the desktop contact detail, deal creation, and linked-deal experience.
frontend/…/Organization.vueShows the desktop company detail with people, deal tabs, and contact linking.
frontend/…/ContactModal.vueShows contact creation and input validation.
frontend/…/OrganizationModal.vueShows company creation and website prefill.
frontend/…/useContactFields.tsShows the client contract for contact email and phone changes.
frontend/…/router.jsShows the list and detail routes for both record types.