Announcement

Collapse
No announcement yet.

Same entity on one-to-many or many-to-many relationship

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

  • Same entity on one-to-many or many-to-many relationship

    Hi,

    first of all thanks for EspoCRM.

    We created some relationships one-to-many and many-to-many. We noticed that one entity can have a self-reference which is something we would like to avoid.

    For instance:

    Relationship: Competitors (Account many-to-many Account)

    If we edit the Account "A", we can choose "A" itself as Competitor. How can we filter "A" out of the list of Competitors?

    If there is anything you need me to provide more, please feel free to ask.

    Thanks.


    Regards

  • #2
    Hello
    As I see it, you need to develop it
    as example you can use relationship between account and contacts in opportunities

    client/modules/crm/src/views/opportunity/fields/contacts.js
    application/Espo/Modules/Crm/Resources/metadata/entityDefs/Opportunity.json (view of the field Contacts)

    Comment


    • #3
      Thank you, Tanya, I'll have a look at it.

      Comment


      • #4
        Hi Tanya,

        another question: will these customizations survive an upgrade of EspoCRM? We do keep backups, but just to be sure.


        Thank you

        Comment


        • #5
          Hello
          If you do this in custom folder - yes

          Comment


          • #6
            Great, thank you very much.

            Comment


            • #7
              7bridges Were you able to figure out how to exclude that Account type? I'm stuck on something similar where I'd like to only allow accounts that are set as vendors to be selected in another entity. I'm not sure how to write the js. I have other filters that will pull the contact associated with the account, similar to the example given. I'm just not sure how to write the js to look for the value in the linked entity and then allow selection.

              Comment

              Working...
              X