2 Replies Latest reply on Oct 3, 2013 8:40 AM by philmcgeehan

    Update quantity of stock—'booking in' layout

    philmcgeehan

      Title

      Update quantity of stock—'booking in' layout

      Post

           Hopefully I can call on the collective expertise of you guys again!

           I have a list of Stock Items with quantities for stock levels at 3 different locations that I want to be able to update using a new "Booking In" layout.

           I've got the layout pretty much set, as you can see in the image above.

           First, I set the location where I want the stock to be booked into in the first pop-up menu.
           The second pop-up menu changes the list of products in the top portal, so that it only shows products from the selected supplier.

           Then I want to be able to click the add button copy the info for that portal record to the bottom portal, which I want to act like a "Basket" (as in online shopping).

           The code I have so far,

           Sets variables from the info on the layout and the selected portal row.
           Opens the a BookIn table
           Creates a new record
           Sets the fields from the Variables
           Commits record
           Closes the table

           Finally, I want to click the Add to Stock button, to commit the stock levels to the quantities for the selected location.

           The thing I'm having trouble with is the relationships between the tables. If anyone has a template I could look at would be good.

           The records get saved to the BookIn table correctly, but I don't know how to get them to appear in the bottom portal.

      Tables; I'm sure there'll be a better way of doing this but this is what I have at the moment.
           I've been looking at this for a long time and I'm going round in circles!frown

      StockProducts
           ProductID
           Description
           QuantLoc1
           QuantLoc2
           QuantLoc3

      Locations
           LocationID
           LocationName

      BookIn
           ProductID
           LocationID
           Quantity

        • 1. Re: Update quantity of stock—'booking in' layout
          philmodjunk

               I don't see why you need an "Add to stock" button at all, Simply getting the records in the table of the portal at the bottom should have done that already.

               But then I don't recommend that you use your current structure for managing inventory either. Your current design approach requires that you define new fields(QuantLoc1, QuantLoc2...) and update your system to use them in order to add a new location should such a change become necessary.

               I suggest using what I call an Inventory Ledger to log items in and out of inventory. A field in such a table can record the location to which you are adding or removing items. Your BookIn table is very close to this ledger type approach already.

               See this thread for more about this method: Managing Inventory using a Transactions Ledger

          • 2. Re: Update quantity of stock—'booking in' layout
            philmcgeehan

                 Yeah, I went into it without really knowing how I was going to achieve the end result; never a good idea (PPPPP).

                 Thank you for the link to your other post.