1 Reply Latest reply on Jun 15, 2010 10:46 AM by philmodjunk

    Auto Update Quantities script

    dizm

      Title

      Auto Update Quantities script

      Post

      Im a relatively new user of FMP 11 on Mac OS X. ]

      I'm trying to write a script that will automatically update the quantities in stock after an order has been placed. The order form creates line items in the Line Item table/layout and im trying to have the qauntities in the Products table ( joined to LineItems by the fields _kp_Itemnumber and _kf_itemnumber) be changed as soon as an order is marked as shipped. Any help would b appreciated.

        • 1. Re: Auto Update Quantities script
          philmodjunk

          A different approach for this is to use an Inventory Log. It works like a check register to track each change in inventory as a separate record for each such transaction. With that approach your Line Items table can function as the Inventory Log and your inventory levels are also computed automatically. If your are interested in that approach search this forum for Inventory Log and you'll find several threads.

           

          Alternatively, you could have several fields in your products table:

           

          Total Received (Number)

          Total Sold (calculation, Sum ( LineItems::Qty )

          On Hand ( Calculation, Total Received - Total Sold )