4 Replies Latest reply on May 17, 2016 2:05 PM by wynnb

    How to show child object field data in an email?

    wynnb Specialist

      Hoping someone knows the right expression syntax for this-

      I created a notification email for when a Release Project goes to Active status. In the body, I show certain field data (Release number, name, dates...), but I also want to show the start/end dates for each of the milestones.

       

      How can I call fields from a child object of the Release? I'm looking to add something like:

       

      1st Milestone Name: Start Date

                                        End Date

      2nd Milestone Name: Start Date

                                         End Date

      etc.

       

      Any help is appreciated.

       

      Bryan

        • 1. Re: How to show child object field data in an email?
          elysey Apprentice

          Hi Bryan

          Are you running HEAT cloud?  If not, what version of HEAT are you running?

          • 2. Re: How to show child object field data in an email?
            wynnb Specialist

            We're running 2015.2.1.1 - premise.

            • 3. Re: How to show child object field data in an email?
              daveb1 Apprentice

              I think using the function ForEachChild is your best bet.  Try this expression in the body of the email of a send email quick action for Release:

               

              $(ForEachChild("ReleaseProject#", RecId, "ReleaseMilestone#.ReleaseAssociatesMilestone", "Subject + ': ' + StartDate + '\r\n\t' + EndDate + '\r\n'", "SequenceOrder ASC"))

               

              Will give you:

              Release and Deployment Planning: 5/9/2016 9:44:38 AM

              5/9/2016 9:44:38 AM

              Build and Test Release: 5/9/2016 9:44:38 AM

              5/9/2016 9:44:38 AM

              Service Testing and Pilot: 5/9/2016 9:44:38 AM

              5/9/2016 9:44:38 AM

              Deployment Preparation: 5/9/2016 9:44:38 AM

              5/9/2016 9:44:38 AM

              Deployment: 5/9/2016 9:44:38 AM

              5/9/2016 9:44:38 AM

              Early Life Support: 5/9/2016 9:44:38 AM

              5/9/2016 9:44:38 AM

              Release Review and Closure: 5/9/2016 9:44:38 AM

              5/9/2016 9:44:38 AM

              1 of 1 people found this helpful
              • 4. Re: How to show child object field data in an email?
                wynnb Specialist

                Thanks David - that works!

                 

                I modified it a little, to format the dates:

                 

                $(ForEachChild("ReleaseProject#",   RecId,   "ReleaseMilestone#.ReleaseAssociatesMilestone",   "Subject + ': ' + (FormatDate(StartDate, 'ddd MMM dd yyy')) + ' - ' + (FormatDate(CompletionDate, 'ddd MMM dd yyy')) + '\r\n'",   "SequenceOrder ASC"))

                 

                Which gives me an output like this:

                Milestone Schedule:

                Inception: Tue May 17 2016 - Fri May 20 2016

                Elaboration and Construction: Mon May 23 2016 - Sat May 28 2016

                Transition-Entry: Mon May 30 2016 - Sat Jun 04 2016

                Transition-Exit: Mon Jun 06 2016 - Sat Jun 11 2016