3 Replies Latest reply on Nov 9, 2017 2:14 AM by lgtandi

    Set conditional read-only on a relationship field

    Donna Apprentice

      Within CI.workstation I want to set up that if the owner field is empty or null then the owner business unit and department fields are editable

      otherwise the data is pulled in from the employee record and read only.

       

      In the object CI.workstation owner is related to [employee#.]Department and [employee#.]BusinessUnit

      in all cases when the record is updated/saved without an owner these fields can be changed.

      In the case of Department is should force the choice the value to be empty or from its picklist.

       

      I thought that this could be a business rule but that does not seem possible - any ideas?

       

      thanks

      Donna

        • 1. Re: Set conditional read-only on a relationship field
          DTurner Expert

          Hi Donna,

           

          I have had a look at this and think I have found something which meets your needs.

          First of all, I setup a triggered action which updates the Org Unit if the Owner field is changed.

          Search and Link: $([Employee#.EmployeeAssociatedCI]OrgUnitLink_RecID)

          I then setup a read-only rule on the Org Unit form element: $(!IsNull(Owner))

          I have excluded Department from the above examples, but the process would be the same.

           

          In terms of forcing the Department choice, that would be done by validating the field using a pick list. This can be a static list or you can constrain based on values in the current record.

          I would be happy to provide further details as to any constraints if desired- please let me know what values you would like to appear in the pick list (e.g. based on OU or perhaps another field)

           

          Hope this helps, Donna

          • 2. Re: Set conditional read-only on a relationship field
            Donna Apprentice

            sorry I found this confusing and it did not work for me.  I appreciate your time however.

            • 3. Re: Set conditional read-only on a relationship field
              lgtandi Specialist

              I'm not sure whether I understand your question correct but if you main problem is to make the "Organizational Unit" field read-only if the "Owner" field is set, I would expect that a Read-only rule for field "OrgUnitLink" with the expression

               

              $(nvl(Owner, "") != "")

               

              would do the job.