3 Replies Latest reply on Sep 24, 2012 2:49 PM by SueFrost

    Calculated Field Not Calculating

    SueFrost

      Title

      Calculated Field Not Calculating

      Post

           Hello!  I'm very new to Filemaker - using it for my own small business. I am familiar with relationship databases and scripting. (In my day job, I do Lotus/Domino development.)

           I've started with the Starter Solutions and since the Invoice and Inventory solutions both do parts of what I need, I combined some of the tables into one custom solution.

           I've moved the Inventory and Stock Transactions from the Inventory solution to the Invoices solution. The tables got moved and I've recreated the relationships. I've moved the scripts as well. As far as I can see, everything looks good and I'm not seeing any errors being generated.

           However the Units on Hand field on the Inventory table isn't being calculated when I add a new Stock Transaction. I've checked everywhere I can think of - field properties, relationships, the script to calculate the value. 

           Now I'm at a loss where else to look. No look searching the forum either - I'm probably not asking the question correctly.

           All assistance is welcome.  Thanks!

            

        • 1. Re: Calculated Field Not Calculating
          SueFrost

               So apparently all I needed to do was post the quesiton here.

               The problem was in the calculation. In my attempts to figure out what was happening, I retyped the formula and left out part of the formula. Makes a difference.

          If ( IsEmpty ( Sum ( Stock Transactions::Units In ) - Sum ( Stock Transactions::Units Out ) ) ; 0 ; Sum ( Stock Transactions::Units In ) - Sum ( Stock Transactions::Units Out ) )

          <>

          If ( Sum ( Stock Transactions::Units In ) - Sum ( Stock Transactions::Units Out ) ; 0 ; Sum ( Stock Transactions::Units In ) - Sum ( Stock Transactions::Units Out ) )

                

          Thanks all - I'm sure I'll have more questions.

          • 2. Re: Calculated Field Not Calculating
            philmodjunk

                 I recommend you take a look at merging the lineitems and stock transactions tables into a single table if you want to update inventory the moment an item is added to an invoice.

                 The quantity field in your invoice portal then becomes the quantity "out" in the transactions table.

            • 3. Re: Calculated Field Not Calculating
              SueFrost

                   Thanks!

                   That's exactly what I'm after.