8 Replies Latest reply on Oct 28, 2016 10:21 AM by coreequip

    Invoice - Script Value List

    coreequip

      Good Morning Community,

       

      i have a little problem, we are using the Invoice template from Filemaker.

       

      When we want to add a new product to the invoice, it takes the value from the Item name, but when it is added to the invoice, it randomly takes a product part number. (We have some products that have the same name/description).

       

      Question:

      We would like to change the script, so that it takes the information from the part number (Which is Unique) and then puts the rest of the information into the invoice.

       

      add product.jpg

        • 1. Re: Invoice - Script Value List
          SteveMartino

          Might be easier to post a file with some sample data.  Most likely there is a problem with a look up or calculation, or maybe the relationship, or the script Trigger | Refresh Search.  If you are allowing record creation through the relationship, you may also have a problem there.

          Easiest is to post a file, and/or watch it thru the debugger for some clues.

          • 2. Re: Invoice - Script Value List
            beverly

            Look at the button in the Starter Solution. It is calling the script AND passing a parameter. The parameter is the name of the product as well as the ID of the product (in a list).

             

            Did you change the popup to include something else? If you need to pass the PartNumber, you can do that in the button that calls the script. Then you need to change the script to read that 'parameter' (part of the list).

             

            beverly

            • 3. Re: Invoice - Script Value List
              philmodjunk
              it randomly takes a product part number. (We have some products that have the same name/description).

              I suspect that this is part of the problem. Are you truly getting a random part number or is it that you are getting a different part number but for a product that happens to have the same name?

              • 4. Re: Invoice - Script Value List
                coreequip

                Sorry for my late response, i had been sick and then a lot of work had been built up that i needed to finish first.

                 

                Let me try to explain it again:

                 

                I search a item by the part number, click on it and it takes it to the "Invoice Data Portal".

                While transferring it from the Side Control to the Invoice Data Portal, it takes the part number from a item that has the same name as the item that i picked.

                 

                So you can't really say it takes it randomly.

                 

                 

                I did a quick fix while i was sick, changed all the items with the same name to a unique name (added a the part number to the item name). and changed the field to a unique field so that it can not have the same name as any other item. I just like that as a temporary solution.

                 

                Thank you

                • 5. Re: Invoice - Script Value List
                  philmodjunk

                  That confirms my guess as to the problem. With your current design, you'd need to stick with unique names. If you have to have duplicated names, you'll need to alter the design to use a value selection method that can work when you have duplicate names.

                  • 6. Re: Invoice - Script Value List
                    coreequip

                    Hello again,

                     

                    while fixing another problem, i think i find a solution to this problem.

                     

                    Where we choose our products from is a side control and that shows the data from "Products | Popover"

                    The relationship from the table "Invoice Data" to "Products | Popover" was via the field "Item".

                    I changed it to the relationship "Product ID Match Field" and it seems to work.

                     

                    Could this been a solution in your opinion?

                     

                    Thank you and best regards

                    • 7. Re: Invoice - Script Value List
                      philmodjunk

                      That sounds reasonable. And selecting products in a popover where you can use a portal to list data from multiple fields, not just the two you are limited to in a value list, is one of the "alternative selection methods" that I was referring to.

                       

                      You referred to a "value list" in your original question and technically, the selection popover used here is not really a value list and thus has options not possible in a simple value list.

                      • 8. Re: Invoice - Script Value List
                        coreequip

                        Ya after seeing the relationships, i thought the same that the name is totally off.

                         

                        Looking to solve one problem, actually solving another one... happens a lot i guess.

                         

                        Thanks you guys and girls!