Total a field from all related Quote Items and passing to parent Quote

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bgpus
    Junior Member
    • Dec 2020
    • 10

    #1

    Total a field from all related Quote Items and passing to parent Quote

    I have a field on all of my Quote Items that calculates the sqft of Height x Width (cItemSqft).

    I would like to total all of the cItemSqft fields in the parent Quote (cTotalSqft) float field.

    I have tried:

    Code:
    cTotalSqft = entity\sumRelated('quoteItems', 'cItemSqft');
    Code:
    cTotalSqft = record\sum('QuoteItem', 'cItemSqft', 'quoteId', id);
    Still unable to get this working. Any ideas?
  • lazovic
    Super Moderator
    • Jan 2022
    • 1053

    #2
    Hi bgpus,

    Please try using the following formula script:
    Code:
     cTotalSqft = entity\sumRelated('items', 'cItemSqft');
    Last edited by lazovic; 06-02-2025, 10:58 AM.

    Comment

    Working...