1 Reply Latest reply on Feb 4, 2015 6:40 AM by philmodjunk

    Store maximum of a field of child table in the parent table automatically

    Vicspidy

      Title

      Store maximum of a field of child table in the parent table automatically

      Post

      I hope Title would've make it clear however there're multiple entries in a child table for a parent item against multiple dates. I need to store the latest date or greatest date from the child table in the parent record.

        • 1. Re: Store maximum of a field of child table in the parent table automatically
          philmodjunk

          Do you really need to store it or just display it?

          A calculation field defined as: Max ( ChildTable::Field )

          will display the maximum value of Field over the set of related ChildTable records. This is an unstored calculation. If, for some reason, you need a stored value, a script can use this expression with set field to set a number field in the parent record and this script can be performed by an OnObjectSave trigger on ChildTable::Field to update the number field every time a value is added. The same script would need to be run after a child record is deleted as well.