Announcement

Collapse
No announcement yet.

Unable to link field in custom entity 1 to custom entity 2

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

  • Unable to link field in custom entity 1 to custom entity 2

    First of all I appreciate the developers of the ESPO crm, I am new to it and I really found this CRM very useful.

    Could anyone please help me with the step by step guide to link one field from custom entity 1 to another custom entity 2 ?

    I don't have as much knowledge of coding so if there is guidance step by step so that will be appreciated.

    My basic concern is that I have made custom entity 1 in which there is 3 enum fileds which save some records and I want to fetch that record in the enum filed into my second custom entity. (it is similar to industry field in account entity and same field linked in the lead entity as business type)

    I have checked the same topic on this forum but unable to do this with shared information so need complete steps so I can do this.
    Last edited by Deepak; 09-19-2022, 09:30 AM.

  • #2
    Hi Deepak,

    First you need to create a relationship between your custom entities:
    1. Go to Administration > Entity Manager > Custom Entity 1 > Relationships and click on the Create Link + button.
    2. Select Foreign Entity: Custom Entity 2, Link Type: One-to-One Right and click the Save button.
    Next, we need to create fields for Custom Entity 2, which will store the values ​​from the related Custom Entity 1:
    1. Go to Administration > Entity Manager > Custom Entity 2 > Fields and create three fields with the Foreign type.
    2. For each field, select Link: Custom Entity 1 and Field: the field that you will need to copy from Custom Entity 1 to Custom Entity 2.
    After creating the three fields, go to Administration > Layout Manager > Custom Entity 1 > Detail and drag from the Available Fields column to the Layout field Custom Entity 2 (so that when creating a Custom Entity 1 you can choose which Custom Entity 2 to then transfer three fields of the Enum type to).

    Next, go to Administration > Layout Manager > Custom Entity 2 > Detail and drag the three previously created fields from the Available Fields column to the Layout.​

    Finally, try to create some Custom Entity 1 and select values for fields of the Enum type in it, also select some Custom Entity 2. After saving Custom Entity 1, go to Custom Entity 2 and check the result.

    Comment


    • Deepak
      Deepak commented
      Editing a comment
      Thanks for the instructions step by step, I really appreciate your response and I have tried the above steps and got the result.

    • Deepak
      Deepak commented
      Editing a comment
      But let me explain my concern, In custom entity 1 I have 3 enum field with static data stored in drop down fields. In custom entity 1 while saving the record I can select from the drop down list then save the record. With your steps I am able to fetch the individual record in custom entity 2 but in this the fields are read only and showing value after saving the record. I want drop down list in the linked fields in custom entity 2 as well fetched from the records of custom entity 1. Let me know if it is possible.

  • #3
    Deepak,

    It's possible, but it will be a little more difficult.

    You will need to create in Custom Entity 2 three exactly the same Enum fields with the same values ​​(static data) as in Custom Entity 1.

    After creating the fields in Custom Entity 2, go to Administration > Entity Manager > Custom Entity 2 > Formula and paste these lines:
    Code:
    firstEnum = event.firstEnum;
    secondEnum = event.secondEnum;
    thirdEnum = event.thirdEnum;
    Replace firstEnum, secondEnum and thirdEnum with fields Names (not Labels, but Names), and the word event with the Name (again, Name, not Label) of your Custom Entity 1.

    In this case, you will be able to view the data of these fields in the drop-down lists in Custom Entity 2, but in any case, the values after saving will be set to the same as in the linked Custom Entity 1.

    If you have any more questions or something is not clear, I will be happy to help you.​

    Comment


    • #4
      Same scenario should work with MultiEnum fields as well?
      As I tried replacing Enum with MultiEnum but this wasn't working

      Comment

      Working...
      X