1 Reply Latest reply on Oct 9, 2018 4:37 AM by IJU

    How to use ForEachChild in an Incident QuickAction Email

    TxtEva Apprentice

      This links to an older post of https://community.ivanti.com/thread/63209

       

      I'm aware this likely might need to run in a Workflow that is called by the QuickAction or some sort of Composite action. However I've not used ForEachChild before and while I've been looking around various posts I can't quite get my head around it.

       

      The Incident Customer is in the name of [Frs_CompositeContract_Contact]DisplayName.

      I would like an email from an Incident which includes a list of each LocationAuthorityUser (on a different BO) which is linked to Location of the Customer [Frs_CompositeContract_Contact#.IncidentAssociatedCustomer]EmployeeLocation.

      Also I only want to include them in list the if AuthorityEndDate is equal to 31/12/3000 (the default end date for an active Authority).

       

       

      I've tried to work out the ForEachChild but I'm pretty sure I've got it very wrong... any advise to point me in the right direction please? I've tried this in an email and tried to update a blank field but it just updates with the whole formula so it's obviously not quite right.

       

      ForEachChild("LocationAuthority",

          RecId,

      EmployeeAssocLocationAuthority,

              "if LocationAuthorityLocation == [Frs_CompositeContract_Contact#.IncidentAssociatedCustomer]EmployeeLocation AND AuthorityEndDate == '31/12/3000' then LocationAuthorityUser + ';' else ''",

          "LocationAuthorityUser ASC"))

       

       

      We've added the BO of LocationAuthority which includes various fields e.g.

      Name of Authority: LocationAuthorityUser

      Location: LocationAuthorityLocation

       

      Also the following relationships:

      LocationAuthorityAssocLocation

      EmployeeAssocLocationAuthority

      IncidentAssocLocationAuthority

       

      Any help is gratefully received, thank you!

        • 1. Re: How to use ForEachChild in an Incident QuickAction Email
          IJU Specialist

          Hello Eva,

           

          let my try to fix this expression:

           

          Old:

          ForEachChild("LocationAuthority",

              RecId,

          EmployeeAssocLocationAuthority,

                  "if LocationAuthorityLocation == [Frs_CompositeContract_Contact#.IncidentAssociatedCustomer]EmployeeLocation AND AuthorityEndDate == '31/12/3000' then LocationAuthorityUser + ';' else ''",

              "LocationAuthorityUser ASC"))

           

          New:

          ForEachChild("LocationAuthority",

              RecId,

          "Employee#.EmployeeAssocLocationAuthority",

                  "if LocationAuthorityLocation == [Frs_CompositeContract_Contact#.IncidentAssociatedCustomer]EmployeeLocation AND AuthorityEndDate == '31/12/3000' then LocationAuthorityUser + ';' else ''",

              "LocationAuthorityUser ASC"))

           

          So at first sight the only thing wrong was the Child Relationship ref. You had just included the name of the relationship but not the business object itself. Try if that fixes your issues. Oh...and try adding the hyphants as well

           

          Kind regards

           

          Immanuel Jungheim

          Consultant

           

          ITSM Group – Be Better.

          www.itsmgroup.com

          1 of 1 people found this helpful