1 Reply Latest reply on Jun 10, 2014 6:16 AM by philmodjunk

    Trying to Update Line Items in Portal

    AdamHorne

      Title

      Trying to Update Line Items in Portal

      Post

           I'm using Filemaker to track Equipment.  Practically all of my items are part of a kit.  
            
           When "Kit A" is ordered, it comes with (2) "Item 1A" and (1) "Item1B" as a complete kit.  I've created an accessory table that stores all those records and when I add "Kit 1" to my order a script will fire off and add its accessories to the order with the default QTY.  All good.
            
           My problem is when I decide I need (2) Kit A's, after my script has ran.  It will duplicate the line items as such:
            
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
                               ITEM                          QTY
                               Kit A                          2
                               

                                    Item 1A

                          
                               2
                               

                                    Item 1A

                          
                               2
                               

                                    Item 1B

                          
                               1
                               

                                    Item 1B

                          
                               1

                 

            
           My goal is for it just to update the accessory line and not duplicate it as such:
            
                                                                                                                                                                                                                                                                                                                                         
                               ITEM                          QTY
                               Kit A                          

                                    2

                          
                               

                                    Item 1A

                          
                               4
                               

                                    Item 1B

                          
                               2
            
           My initial thoughts are to some how mark the accessory lines, delete them and rerun the script on the entire order.  However, this doesn't seem like the best option, especially if I have a large order and just update 1 item.  
            
           Is it possible to have the QTY as a calculation?  However, there are times when I can only send out (1) of Item 1A, although it typically ships with (2).
            
           Any suggestions would help.  Thanks.   

        • 1. Re: Trying to Update Line Items in Portal
          philmodjunk

               Presumably each row in your example represents a record in a table and your script is generating a new record for the kit and each component of that kit.

               When you create the record for each kit, use the specified Qty of kits to specify the quantity instead of 1. When you run down the list of accessories multiply the specified Qty in your accessory table by this same value.

               You will probably need to use set variable to copy this value to a variable at the start of your script so that you have it when your script needs to to compute quantities.