7 Replies Latest reply on Nov 24, 2009 2:21 PM by tangent

    Portal Total

    tangent

      Title

      Portal Total

      Post

      Hi!

       

      I have a portal set up where user enters product data like Qty, Description, Price. I have a field at the end of each line of this that does the math for each line item (called LineItemTotal). I am trying to get a subtotal field going that obviously adds up each line item

       

      So far I have tried the calculation of:

      Sum(LineItemTotal)

       

      Problem is, the object only recognizes the first line item and doesn't seem to notice when new line items are being added in the portal.

       

      Thanks!

      ~TPS

        • 1. Re: Portal Total
          comment_1
            

          Try a calculation field in the parent table (Invoices?) =

           

          Sum ( LineItems::LineItemTotal )

          • 2. Re: Portal Total
            philmodjunk
              

            In the LineItem table, define a summary field as "total of" LineItemTotal.

             

            OR

             

            In the parent table (The one your layout refers to in Layout setup...)

             

            Define a calculation field as Sum(PortalTableOccurrence::LineItemTotal)

             

            The second field, in my experience, updates a bit better when you need to put a "portal total" on your layout below the bottom of your portal. The other field is good for putting in reports based on your portal's table.

            • 3. Re: Portal Total
              tangent
                

              The Sum ( ReturnLineItems::LineItemTotal ) works when calcualting the first line item of my portal when I fill it out, but it doesn't notice/calculate any data added to subsequent lines. I toggled the storage option on & off with the same results.

               

              Thanks!

              ~TPS

              • 4. Re: Portal Total
                philmodjunk
                  

                In which table did you define this calculation field?

                 

                It should be defined in the Parent table not the portal's table.

                • 5. Re: Portal Total
                  tangent
                    

                  My form has two tables: one that holds the customer data and one that holds the product data. The calculations I am doing reside in the second one. I'm guessing I need some of those to reside in the first table? See image.

                   

                  Thanks!

                  ~TPS

                   

                   

                  • 6. Re: Portal Total
                    philmodjunk
                      

                    Exactly,

                     

                    The calculation using Sum(ReturnLineItems::LineItemTotal) should be defined in Returns.

                     

                    Aggregate functions such as Sum, when used in this fashion, are computing a total of all records in the child table (ReturnLineItems) that are related to the current record in the Parent table (returns).

                    • 7. Re: Portal Total
                      tangent
                         Beauty! That did the trick. Thanks!