Announcement

Collapse
No announcement yet.

Best way to have a field control another fields value???

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

  • Best way to have a field control another fields value???

    I want to thank you all for your assistance. I need help with limiting a fields value drop down value, (related Users) that have a skill (Also a related dropdown) I have been scavenging this site for days and cannot seem to find a answer. If this is not possible, is it possble to set a filter based on the value of another field based on another field in the same row? Again, I am new at Espo but really think it is an awesome platform.
    Thank you very much for your consideration.

  • #2
    Hi,

    Check this post it shows how to use dynamic logic to set values of an enum field (drop down) based on the value of another enum field in the same entity https://forum.espocrm.com/forum/gene...ther-emum-list

    If you need to do more sophisticated comparisons or apply other logic conditions and you are willing to go beyond the Admin GUI to customize your form, you can do this with the dynamic handler feature https://github.com/espocrm/documenta...mic-handler.md
    Last edited by telecastg; 07-11-2020, 08:05 PM.

    Comment


    • #4
      Could you please provide an example of what are you trying to accomplish ?

      The core dynamic handler class provided out of the box is very powerful even without the extension so with an example I can suggest the "easiest" approach in my opinion of course

      Comment


      • #5
        I have an assignments entity that I need to assign users to. The users must have skills that match another n-n entity table skills. There are many users and over 80 skills. I do have the Skills table linked so it shows a relationship panel with users that have skills. I am trying to make it so when you select a skill in the assignment entity (in Edit), only users with that skill show up. I can do it via filter, but it is way to cumbersome. I really appreciate any pointers as to how I can make this happen. THANK YOU SO MUCH!!

        Comment


        • #6
          Hi Redwood ,

          I adapted your use case to our system (the scenario is very close) so I could develop a working solution for the conditional multi link use case,and it took me longer than I though because I couldn't figure out how to use "joins" as filtering conditions for collection, so I ended up creating a new field type and decided to post it as a full tutorial that you can check here: https://forum.espocrm.com/forum/deve...-multiple-link and will be easy to adapt to your own needs.

          From the "efficiency" point of view my solution is not optimal because since I couldn't figure out how to use "joins" in the collection filter options (I did not find any examples in the full Espo code or documentation about it) I ended up "highjacking" the flow by inserting an Ajax call to create a "filter" array to use for loading the collection (which is another ajax call) so I use two ajax calls instead of one, but for practical purposes I don't think that performance will be affected significantly.


          Comment

          Working...
          X