1 Reply Latest reply on May 29, 2013 11:44 AM by Mike_Mitchell

    How ro clear a depending entry after changing the parent field?

      Dear all,

       

      I have some layouts where I can select e.g. a company and then a second field contains all the employees of this company in ordner to select one. What shall I do if I change the parent company? In this case the employee still populate the second field though the formerl selected person is not one of the now selected company. Does anybody have an idea what to script on which trigger? Something like "if the company changes clear the employee field"? Or is there a bette rconcept than just to empty that field? Thanks in advance.

        • 1. Re: How ro clear a depending entry after changing the parent field?
          Mike_Mitchell

          Hello, Luna.

           

          Not entirely sure I understand the question. I select a value in Field A. What appears in Field B? You say "all the employees in order to select one"? Do you mean it's a checkbox set? Or is it a pull-down list of some sort? Where does it get the list of values - from a related table?

           

          In either case, if all you want to do is clear the contents of Field B when Field A changes, you can do that without a script. Just set an auto-enter calculation in Field B to remove any values that don't belong there. Assuming you have a value list of employees, it might look something like this:

           

               Case ( not IsEmpty ( Field A ) ; FilterValues ( Field B ; ValueListItems ( Get ( FileName ) ; "Employee List" )))

           

          Set the auto-enter calculation to replace the value in the field. Whenever Field A is populated, this will strip out any values in Field B that aren't part of the value list.

           

          Note that this will prohibit any values from being entered in Field B that aren't a member of the value list whenever Field A has a value. If that's not what you're looking for, let us know more details and maybe we can give you a better answer.

           

          Mike