Announcement

Collapse
No announcement yet.

Link assets with personnel id

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

  • Link assets with personnel id

    Hello all, i have a really little experience with espo and i need some advice to perform the subject's task for a study case.

    I have two entities: "contact" and "assets" and i need to link this all together taking as primary key the "Job Card ID number" (JCN).

    In the contact entity i have only:
    - Name, Surname, Job Card Number (JCN)

    In the asset entity i have:
    - JCN, Asset name, comments

    I have try to set a many-to-many relationship but i don't understand how it works and if i need it for my study case.
    The JCN is an alphanumeric field and it's the key to link the two table that i have (photos in the attachment).

    In my scenario i need to be able to import the .csv that contains the contacs and the assets and i need that Espo automatically match the JCN: with this solution i can open the contacts and click on the JCN code and i will see the related asset entity.

    Thank you very much and sorry for my english.

  • #2
    Hi, it depends, if one asset can be connected (related) to only one job card number or to more than one. If it is only one, you need a one-to many relationship (one jcn has more than one asset).
    If your assets can relate to more than one jcn at the same time, you need many-to-many.

    Keep in mind, that you will have to put the fields, that will be created by the relationship, into your entities, so you can see the related fields (you do that in layout). That way you can see the related assets<->jcn and choose new connections for both of them.

    Don`t hesitate to do a bit trial and error, until you understand, how it works. When you create a realtionship, there will be field names created by espocrm. At this stage you still can adjust these names to your liking. After the relationship is created, you cannot change the field names anymore. But you can still change the label names. I have learned, that it is very important to think thoroughly about the naming, because later, when you have several or a lot of relationships, it can be difficult to remeber, what relationships you have.

    In your case I would create the two entities first and import a few records in each of them. Then you create your relationship and test, if it works. If not, do tril and error. I it works, you can import the rest. I don`t know, if you will have the relation between the records manually, but I guess so.

    Perhaps this helps a bit (in this case the relationships connected two entities with the names studios and performers):

    Click image for larger version  Name:	espo_many-to-many.jpg Views:	0 Size:	53.1 KB ID:	78571
    Last edited by shalmaxb; 01-31-2022, 12:35 PM.

    Comment


    • #3
      Wow ! It's super-clear now. Thank you very much shalmaxb for your explanation i'll try to play around with it and i will let you know if i have done my task

      Comment


      • #4
        I have achieve my task with many-to-many relationship thank you very much shalmaxb !

        Comment

        Working...
        X