Problem/Motivation
I want to create hybrid contact bundles where the contact may be a company or an individual.
Currently crm_contact is laid out with a name field that is hidden for person contact bundle, but visible for organisation and household.
Proposed resolution
Add the full name field to all bundles and have a boolean field to confirm whether entity is person or organisation, and conditionally show the field based on the results.
User interface changes
Add a boolean field to confirm whether contact is an individual or organisation and toggle visibility of full name field based on this.
Comments
Comment #2
jdleonardI'd love to learn more about your use case. What are you trying to achieve with a hybrid Contact Type that can't be achieved with the Person and Organization Contact Types?
Comment #3
naheemsays commentedI am building a legal case management system with crm and crm_case as its foundation.
Each case as multiple correspondent entities, which then refer to a crm_contact entity and add fields for contact name, email and telephone number which are case specific.
I have around 20 crm_contact entity bundles including client and other party and expert, and solicitor, however these are not always either a person or a company/organisation.
Comment #4
jdleonardCool use case! Thank you for that context.
Person is designed to be used for any Contact that represents a human. Drupal CRM is opinionated about this in part because Person is the only Contact Type that can be mapped to a User. For most use cases, the three built-in Contact Types (Person, Organization, and Household) are sufficient. While one is free to create additional Contact Types, it is generally ill-advised. What if a given human is both a client (for one case) and an expert (for another case)? Having two Contacts representing the same human necessitates duplication of information and could be otherwise problematic.
I can't see us adding "a boolean field to confirm whether entity is person or organisation" because this is already represented by whether a Contact's bundle is "Person". Similarly, the Full Name field only applies to the Person Contact Type because first/middle/last/etc wouldn't make sense for a non-human (okay, maybe a pet?)
It sounds like your use of many Contact Types is mostly to facilitate tracking different sets of information for different subsets of Persons / Organizations. There are existing feature requests that may solve for that (a Contact Profile or similar could be attached to some Persons and some Organizations as appropriate):
#3577342: Contact Profile (crm_contact_profile)
#3557244: Contact Type fieldable sub-types
I encourage you to contribute to the other feature requests as you are able.