Change field from optional to required if conditions are met

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jcortes0309
    Member
    • Mar 2016
    • 68

    Change field from optional to required if conditions are met

    In my custom entity I have a "primary" field with two drop down choices: 1) account and 2) contact. Right now I always require at least one contact to be included, but I only require an account name if the drop down choice is "account". Is there any way for me to make the accounts field required, before the record is saved, if the drop down choice is account?

    Thanks
  • jcortes0309
    Member
    • Mar 2016
    • 68

    #2
    I do realize I created this post in the incorrect forum; however do not know how to move it to another forum or delete. Is there a way to do so or can this only be done by moderators/administrators?

    Comment

    • yuri
      Member
      • Mar 2014
      • 8627

      #3
      You can do it in recordView detail/edit class. There are methods setFieldRequired, setFieldNotRequired
      If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

      Comment

      Working...