4 Replies Latest reply on Sep 23, 2016 11:55 AM by [email protected]

    Fail quickaction before running

    stapletj@tbh.net Apprentice

      I have a quick action to resolve an incident and complete the associated tasks. I want it to fail if there are tasks not owned by CurrentLoginId()

      It does this, thanks to a validation rule in BO.Incident, but not until after filling out all of the Prompted information.

       

      I would make the button invisible, but ChildFold is not supported in hide rules.

        • 1. Re: Fail quickaction before running
          dcogny Expert

          Hi,

           

          I think I am going to need a bit more explanation... what do you validate on the Business Rule? how is your QuickAction setup?

          A couple screenshots would be really helpful.

           

          The issue I see is just organization, you have to make sure that the validation happens before the information filling. That's why I wnat to know what you have, most likely all you need is change the order or add some nested actions (I had to do a couple "Update" blocks in my Request Offering Workflows, because I needed some information stored before other, so something similar for you...).

          • 2. Re: Fail quickaction before running
            AlasdairRobertson ITSMMVPGroup

            Hi Jay

             

            A different approach but will resolve your issue.  Create a new field in the incident object (e.g. TasksNotForMe) as a Boolean (true/false) not stored.  Make this a calculated field.  Add a calculation rule which sets the new flag with the following expression:

             

            $(ChildFold("Incident#",

              RecId,

              "Task#Assignment.Rev3",

              $("1"),

              "+",

              $(Owner != CurrentLoginId() &&

                  Status not in ("Completed",  "Cancelled",  "Rejected"))) >

              0)

             

            Now you can test the TasksNotForMe flag for the quick action hide or disable rules.

             

            Please note this was all tested in 2016.1 there was a calculation issue in 2015.1 from memory.

            1 of 1 people found this helpful
            • 3. Re: Fail quickaction before running
              stapletj@tbh.net Apprentice

              What I've done instead is have it change the status to "Waiting for Resolution" instead of "Resolved" if there is tasks owned by other people. That way it avoids losing the information from the Prompts, and allows the owner to wrap up their part in it.

              1 of 1 people found this helpful
              • 4. Re: Fail quickaction before running
                stapletj@tbh.net Apprentice

                I set this is in the Status field of an updateobject block in the quickaction:

                 

                $(if IsTrueForAllChildren("Incident#",      RecId,      "Task#Assignment.Rev3",      $(Status in ("Completed",  "Cancelled",  "Rejected")))  then "Resolved"  else "Waiting for Resolution")