Announcement
Collapse
No announcement yet.
Additional Fields Embedded into Contact Name Field?
Collapse
X
-
Here's a link to the solution, packaged as a commercial extension. With this extension you can accomplish everything from the extension's admin panel without having to write any code. https://payhip.com/b/VukYG
-
telecastg THANKS very much for your efforts here, this is a great contribution and makes sense to be rolled into an extension, a paid one at that for your time and expertise!!! Really appreciate you contributing to the open-source movement! This is a force to be reckoned with making ripples across the software industry
- Likes 2
-
Hello Zosh ,
Based on Ananya K great contribution https://forum.espocrm.com/forum/feat...name#post66454, here's how you can create a custom PersonName format to include additional "subfields".
In this case I wanted to break down a Contact name "Dr Alejandro José Gonzales Perez Jr" to whom the "Common or Dear" name would be "Alex" like this:
Preferred Name - eg: Alex
Prefix - eg: Dr
First Name - Alejandro
Middle Name - José
Last Name - Gonzales
Mother's Maiden Name - Perez
Suffix - Jr
So we will have the core code name format options:
lastFirst
lastFirstMiddle
firstMiddleLast
Plus custom name format options:
firstMiddleLastMother
firstMiddleLastSuffix
firstMiddleLastMotherSuffix
The field Preferred Name will be an additional field in the Contact entity, it doesn't have to be part of the PersonName complex field.
The result looks like this:
Steps:
1) Create a custom ORM field definition class to substitute the core PersonName field type class:
custom/Espo/Custom/Core/Utils/Database/Orm/Fields/PersonName.php
Ability to add Mother Maiden name as a field for entities type 'Person' - telecastg/person-plus-for-espocrm
2) Create a custom metadata field definition for the personName field type:
custom/Espo/Custom/Resources/metadata/fields/personName.json
https://github.com/telecastg/person-...ersonName.json
3) Create a custom javascript view class for the personName field type:
client/custom/src/views/fields/person-name.js
Ability to add Mother Maiden name as a field for entities type 'Person' - telecastg/person-plus-for-espocrm
4) Create the templates to render each custom variation of the PersonName formats:
client/custom/res/templates/fields/person-name/edit-first-middle-last-mother.tpl
Ability to add Mother Maiden name as a field for entities type 'Person' - telecastg/person-plus-for-espocrm
client/custom/res/templates/fields/person-name/edit-first-middle-last-suffix.tpl
Ability to add Mother Maiden name as a field for entities type 'Person' - telecastg/person-plus-for-espocrm
client/custom/res/templates/fields/person-name/edit-first-middle-last-mother-suffix.tpl
Ability to add Mother Maiden name as a field for entities type 'Person' - telecastg/person-plus-for-espocrm
5) Create a custom complementary metadata definition of the Settings entity to display the new PersonName formats in the Admin > Settings panel
custom/Espo/Custom/Resources/metadata/entityDefs/Settings.json
Ability to add Mother Maiden name as a field for entities type 'Person' - telecastg/person-plus-for-espocrm
6) Create custom language files to make the new PersonName formats "human friendly" to the user in his/her preferred language
custom/Espo/Custom/Resources/i18n/en_US/Settings.json
Ability to add Mother Maiden name as a field for entities type 'Person' - telecastg/person-plus-for-espocrm
custom/Espo/Custom/Resources/i18n/es_MX/Settings.json
Ability to add Mother Maiden name as a field for entities type 'Person' - telecastg/person-plus-for-espocrm
7) Create custom language files to make the new fields labels "human friendly" in the user's preferred language
custom/Espo/Custom/Resources/i18n/en_US/Global.json
Ability to add Mother Maiden name as a field for entities type 'Person' - telecastg/person-plus-for-espocrm
custom/Espo/Custom/Resources/i18n/es_MX/Global.json
Ability to add Mother Maiden name as a field for entities type 'Person' - telecastg/person-plus-for-espocrm
8) Define parameters for the "sub-fields" in the entities where you want to apply the custom format, (in this example apply to the Contact entity), and add the additional field "Preferred Name".
custom/Espo/Custom/Resources/metadata/entityDefs/Contact.json
Ability to add Mother Maiden name as a field for entities type 'Person' - telecastg/person-plus-for-espocrm
9) Clear Cache and Rebuild
- Likes 5
Leave a comment:
-
These two thread might be of interest to you:
Are there plans to add a Middle Name, or Middle Initial, to the Contacts information? Many times you will have multiple people in your contacts not assigned
Is it possible to create a custom template like the 'person-name' templates/js files? Or to customize the person-name template? E.g. to add first-letters and/or title? How would one do this and implement it in a custom resource? Thanks in advance for answers
There might be a few other thread that I have omitted, do a search for "name" and you might find more: https://github.com/o-data/EspoCRM-Le...nd-Design/wiki
Leave a comment:
-
Hi Zosh,
You can try to implement it with Entity Manager. Create the fields that you need and customize the appearance of detail, edit, list views, etc.
More information is there:
Last edited by Vadym; 07-13-2021, 09:21 AM.
Leave a comment:
-
Hello Zosh it's doable, but it require coding. You should create new type of field. I think the best tip for you is to create something similar to address field. You can check our free extension and try to adjust it. Here you have a link: https://devcrm.it/address There you have link to github with all files.
Leave a comment:
-
Additional Fields Embedded into Contact Name Field?
Hi, I've been searching far and wide the last couple hours as someone else must've thought of this before...
My company will, as I'm sure many might do, export lists of Account + Contact records for our marketing partner to send email blast campaigns to. In order to have maximally effective and personalized email campaigns, we account for:- Name Prefix / Salutation
- First Name
- Middle Name or Initial
- Last Name
- Name Suffix (Jr., Sr., family generation, military rankings)
- Common / Dear Name (Shorthand of first name or nickname, whatever person prefers to be called)
If this hasn't been done yet, I do have some development experience, does anyone have any suggestions or direction as far as where I would look in the source code to basically copy the Address functionality over to the Name field to include the extra fields above I'd like to account for?
Thanks and I appreciate any and all input!!1 Photo
Leave a comment: