Announcement

Collapse
No announcement yet.

Add Contacts fields to Account page.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Add Contacts fields to Account page.

    Hi Team,

    Like we have an option to add multiple accounts field to a Contact page, I wanted to see if there is an option to add multiple contacts fields to account page. When I go to layout manager for Account Entity I do not see an option to add the Contacts fields, though I see it in bottom panel but I want to add it to the details page like we do it on the accounts page. Is there anything I need to add to the Account.json file? I tried adding the below but this did not work

    "fields": {
    "contacts": {
    "layoutRelationshipsDisabled": false
    },
    Last edited by bhavikin; 05-27-2022, 02:50 AM.

  • #2
    Hi bhavikin,

    To implement the desired, please do the following steps:
    1. Go to the Administration -> Entity Manager -> Account -> Relationships
    2. Create Link with parameters shown on a screenshot
    3. Add the Contacts field on a Detail view via Layout Manager

    Best regards
    Last edited by Vadym; 05-10-2023, 08:47 AM.

    Comment


    • #3
      Hi Vadym,

      I tried that but this creates a new relationship called Contacts1. I want to use Contacts only. This is because I want to maintain the relationship between accounts and contacts. So if someone associates one contact to one account the account automatically gets assigned to that contact. I can do this on bottom panel and contacts pages and also in Account page but only in bottom panel not as a "field" and that is what my question was. Hope I am clear if not I can explain in more detail.

      Basically Accounts is available as a field in Contacts layout but Contacts is not available as a field in Accounts Layout. And if I do it your way It creates a new relationship does not maintain the existing relationship. See attached screenshots link multiple option seems to be disabled.
      Last edited by bhavikin; 05-26-2022, 07:48 AM.

      Comment


      • #4
        adding images

        Comment


        • #5
          Any help here would be appreciated.

          Comment


          • rabii
            rabii commented
            Editing a comment
            still struggling with this or did you manage to solve it ?

        • #6
          You can't through the GUI, you can only create a new Relationship and use the Multiple-Field links check box.
          It might be possible with code but I'm helpless in this area.

          You must teach your team to use Bottom Panels if you don't want to make it more complex or scratching your head out for a solution.

          Comment


          • #7
            Just in case someone wants to achieve this in future, here is how it could be done, it is actually a very simple and easy to do.

            It is easy to achieve this keeping the same existing contacts relationship just follow step below:

            Create a file under custom/Espo/Custom/Resources/metadata/entityDefs/Account.json

            PHP Code:
            {
               
            "fields": {
                     
            "contacts": {
                        
            "type""linkMultiple",
                        
            "noLoad"false
                    
            }
                }

            Save the file and clear cache and rebuild the system then to entity manager - account detail you will find the field contacts to add to the detail view.
            hope this helps.

            Ps you can create a language file as well to define contacts as Contacts. ​
            Rabii
            Web Dev

            Comment

            Working...
            X