No announcement yet.

Autofilter foreign entities

  • Filter
  • Time
  • Show
Clear All
new posts

  • Autofilter foreign entities

    Hi, I'm adapting Espo to a health solution, so the contact entity will be my "pacient" entity. I have already a "laboratory" and a "drug" entities. Drug has a relation with laboratory (one laboratory, many drugs). In pacient entity, I have 2 relations, one to laboratory, one to drug (both one-to-many).
    In pacient form, I would like to put a laboratory select, and after a drug select.
    How do I do in order to show only drugs from the selected laboratory?

  • #2
    Could you explain more explicitelly how it should work? Where exactly you need to filtel drugs in accordance to lab? Should it work as it does for Opportunity -> Contacts relation based on related Account (see screenshot).
    Attached Files


    • #3
      Yes, for sure I can detail my requirement...

      Contact Entity:
      Contact Laboratory Drug
      John Lab & Lab Vitamin C
      Mary Drugs Science Paracetamol
      Joseph Lab & Lab Vitamin D
      Laboratory Entity:
      Name email
      Lab & Lab
      Drugs Science
      Drug Entity:
      Name Laboratory
      Vitamin C Lab & Lab
      Vitamin D Lab & Lab
      Paracetamol Drugs Science
      When you open the attached image, you'll see the interface I'm working on. When you click the laboratory icon (red), I want to open the normal dialog with all the laboratories. So, you select one of them (let's suppose you've selected "Lab & Lab").

      After that, you have to select a drug. When you select the blue icon to open the drug dialog box, I would like to show only the "Lab & Lab" products. So, the dialog should show only 2 drugs (and not the hole list).

      Easier to understand?



      • #4
        You should look on opportunity entity. There you have links: Account and Contact. And after you choose account field, you can choose from link in contact field only assigned contacts to account. Source code is on github