5 Replies Latest reply on Jul 27, 2016 7:26 AM by [email protected]

    Sending email to problem review board

    stapletj@tbh.net Apprentice

      I am trying to set a triggered task in the problem BO to email someone if they're linked to the PRB. I set the destination email address to "$(Employee#ProblemAssocProfileEmployee.OwnerEmailAddress)" - and get the error Subtype selectors, Employee.ProblemAssocProfileEmployee, are not supported in this expression.⁽¹⁾

       

      I assume that's to do with the email address I'm looking for being part of a child object of the problem, rather than the problem itself.

       

      Could someone suggest another approach to this?

       

      Thanks

        • 1. Re: Sending email to problem review board
          florian1 Expert

          Hi Jay,

           

          since ProblemAssocProfileEmployee is a link table (n:m), it is not possible to directly use this relationship.

          You can however iterate through and concatenate the email addresses:

           

          $(ForEachChild("Problem#", RecId, "Employee#.ProblemAssocProfileEmployee", $(PrimaryEmail + "; ")))

           

          This works just fine for me.

           

          Cheers,

          Florian

          1 of 1 people found this helpful
          • 2. Re: Sending email to problem review board
            stapletj@tbh.net Apprentice

            That works perfectly, thanks!

            is there a reference anywhere for this type of thing? I'd like to get a better understanding of the under-the-hood workings. I'm conversant in (very) basic coding, but I'd like to know the HEAT specific syntax.

            • 3. Re: Sending email to problem review board
              stapletj@tbh.net Apprentice

              While this worked, it will send 5 email if you add 5 people to the PRB.

              I realized, I could add a triggered action to the Employee BO, rather than the Problem one, and it will only send to that employee when they're linked to a problem.

              • 4. Re: Sending email to problem review board
                florian1 Expert

                This is intended behaviour and all based on your trigger (I guess you were using a "on link" rule).

                So yes, you can either have a business rule in the Employee object or define additional/other conditions in your Problem object (e.g. "Problem Status changed and linked employees >=3") to send the mail out.

                 

                For a better understanding of the functions you can also have a look into the Admin help (https://{yourtenant}/HEAT/help/admin/index.html).

                - Reference -> Working with Expressions -> Using Expression Grammar.

                1 of 1 people found this helpful
                • 5. Re: Sending email to problem review board
                  stapletj@tbh.net Apprentice

                  For anyone else who is trying to do this, this is what I've settled on as of now.

                  Under Employee BO Business Rules, I created a triggered action on link to ProblemAssocProfileEmployee that sends to $(PrimaryEmail)

                  In the body of the email, I included something like this, which gives them a list of all of the PRBs they have been added to.

                   

                   

                  You have been added to a Problem Review Board.

                   

                  You are on the Problem Review Board for the following Problem Records

                  $("Num:" + "\t" + "Status:" + "\t\t" + "Owner:" + "\t\t" + "Description:")

                  $(ForEachChild("Employee#", RecId, "Problem#.ProblemAssocProfileEmployee",

                  $(if Status == "Resolved" then null else ProblemNumber + "\t " + Status + "  " + "\t" + Owner + "\t\t" + Description + "\n")))

                   

                  Thanks to Florian Deutsch for the references and snippet.