2 Replies Latest reply on Dec 28, 2017 8:52 AM by SandroPineda

    CurrentUserInTeam () functionality for read-only business rules

    SandroPineda Rookie

      I have a request to reconfigure a form field on an already existing custom object. In my case the field is [Account Number], the request is to change the field to allow it to be edited by members of a certain team. [Operations Team]

      The first part of the request is to have it only be edited up to a certain status type which I have configured as such.

       

      *Statuses are in the  " " *

       

      $(if CurrentStatus not in

           ("    ",

            "    ",

            "    ",

            "    ")

        then true

        else false)

       

      This works but I'm also trying to add the portion of the request that only allows users from a certain team to edit.

       

      I tried using the $(CurrentUserInTeam()) function but can't get it to work.

       

      This is all for a read-only business rule.

        • 1. Re: CurrentUserInTeam () functionality for read-only business rules
          DTurner Specialist

          Hi Sandro

           

          Seems fine for me when using the CurrentUserInTeam function.

          Now if I am in the Customer team, the status is read only. You can also use $(!CurrentUserInTeam("...")) to make it editable for the specified team.

           

          For the first part, it may be worth looking at Change/Problem as I believe OOTB, they use a validation object & pick list to determine record status progression.

          • 2. Re: CurrentUserInTeam () functionality for read-only business rules
            SandroPineda Rookie

            DTurner,

             

            Thanks for the response.

             

            Turns out I just had the syntax for the CurrentUserInTeam set up incorrectly.

             

            $(if CurrentUserInTeam("Team 1")

              then false

              else if CurrentUserInTeam("Team 2")

                   then false

                   else if CurrentStatus not in

                           ("   ",

                            "   ",

                            "   ",

                            "   ",

                            "   ",

                            "   ",

                            "   ",

                            "   ",

                            "   ",

                            "    ",

                            "     ",

                            "     ")

                        then false

                        else true)

             

            I got a couple errors saying it might not work properly when I put in this expression but on the form editor it all works.

            I even tried removing the current user from the two teams and the form field changes accordingly.