Hello, This question is similar to the Github discussion shown below. I would like to achieve similar functionality for the "Account" Contacts but I'm having difficulty making this work. Essentially, if you look at the image below I would like to be able to specify an enum for the Contact Role when adding new Contacts to an account. Thank you very much for your time and consideration.
Announcement
Collapse
No announcement yet.
Enum for Contact Role
Collapse
X
-
Wow. Yes, it did work. I thought it was custom->Espo->Custom->Resources->layouts->metadata->entityDefs->Contact.json that I should create and customize field accountRole. Having trouble understanding file structures as I'm new to Espo
This worked beautifully and thank you.
custom->Espo->Custom->Resources->layouts->metadata->entityDefs->Account.json
{
"fields": {
"contactRole": {
"type": "enum",
"options": ["","a","b","c"],
"isCustom": true
}
}
- Likes 1
Comment
-
Thanks for your help. I’m on my iPhone right now and can’t see how to post a new topic.
is it possible to have documents show up with folders on Portal (ie. Portable role can view documents for account). Documents are structured on CRM with folders. However, when we assign document to an account it only has document and no folder structure. Will I need to do this manually with php ? Would you suggest creating a template for the portal with some type of filter to filter off of document type/category to display it under the dynamically generated Folders?
- Likes 1
Comment
-
Hi guys, do you know what happen to this field contactRole ? I want to add a few more Auto-option but it seem to be disabled now in v7.
Am I looking at the wrong field?
Last edited by esforim; 05-26-2023, 05:52 AM.
Comment
-
This has not changed, the field has been always a varchar. because it will difficult to predecit all job titles in the world. you can check opportunityRole on the contact entity which defines roles for contact on opportunity (it is an enum) because we can define few roles. check this Administration > Entity Manager > Contact > Fields > Opportunity Role
-
-
rabii thank you rabii but that is not it. Opportunity Link is only link to opportunity, I need to edit the contactRole when it link to Account Role.
As you can see I previous made edit but now can't find it. And you can see it not the same role being used.
Here example of my current Opportunity Role
Here is a search of it being test to see if it work, no result.
Here my current list I want to add a few more to:
Comment
-
esforim
You are confusing two different relationships. there is a many to many between contact and opportunity and there you have opportunityRole on the contact which reflect the opportunity role for a contact on an opportunity record. this only exist on the opportunity > contact relationship. on the account > contact relationship they use only a varchar and not emun that's why you can only type in the value of the job title. if you wish to have similar functionality as defined in opportuntiy and contact then you need to create a new emun on the contact and call it (accountsRole should be of type emun) and use it to display the role between contact and accounts. i will double check for you if there is anyway to change this without much hassle.
-
-
Hi @rabii
I think you may have misread the question! All I want to do is to add those Auto-Option/Autocomplete to the list for my Account<>Contact entity. As you can see in my screenshot I have previously done that in v5 (or was it v6) using the Admin GUI menu.
The problem is, now I want to add in more and I can't find where is the setting to make this edit! So I'm lost.
I'm using default field for this (no modification with code) and this was all done via GUI. At least if I remember correctly. It been like 2 years! I can't remember to be honest so I digging through the setting for it and failing miserable.
I don't want to change it to enum which is what czpdf want to do. I just want to find where to go to make add more Auto-Option. I think I'm hijacking this thread and should have create a new thread to save the confusion?
So all I want to do is this find how so I can add the auto-option for my Account<>Contact again, here is what I remember it should be:
Comment
-
hey esforim
I understand what you are trying to achieve but as i think that the field you are looking for is to add option will be contactRole under Account entity. one thing i noticed that the latest version of espocrm has locked that field so not sure if you will be able to add more option (unless if you customise it of course under entityDefs).Rabii
Web Dev
Comment
-
Last edited by item; 05-30-2023, 01:04 PM.
Comment
-
But I'm scare to ping him, he want busy for a few week. I have feeling it block from the UI as well! I was just hoping I'm not looking in the right setting, I tried looking through contact & account entity.
I assume you guy never add this Auto-Complete in your version?
Originally posted by item View PostHi rabii,
yes you are right..
if i understand i think espcrm will the same behaviours than auto-complete State, Country.. or free input without enum type field
Originally posted by item View PostHi rabii,
yes you are right..
if i understand i think espcrm will the same behaviours than auto-complete State, Country.. or free input without enum type fieldLast edited by esforim; 05-31-2023, 05:20 AM.
Comment
-
OK persistence prevail! It seem to be under accountRole field:
But no Option available though.
Doing a search for "contact.json" lead me to this file here:
[s]app/custom/Espo/Custom/Resources/metadata/entityDefs/Contact.json[/s]
Code:app/custom/Espo/Custom/Resources/metadata/entityDefs/Account.json
Code:"contactRole": { "options": [ "Administration", "Staff", "Member of", "Mother", "Father", "Son", "Daughter", "CEO", "Friend", "Referral" ],
Last edited by esforim; 05-31-2023, 05:50 AM.
Comment
-
This is what I thought but after saving and trying it out it still using the old list... I guess I'm still missing a secret code somewhere else.
Already did the usual clear cache, rebuild, log in log out, refresh window.
SEE 2nd commentsLast edited by esforim; 05-31-2023, 05:50 AM.
-
Comment