5 Replies Latest reply on Jan 3, 2014 7:22 AM by philmodjunk

    Price field calculation with selected checkbox items

    JeongwungJeong

      Title

      Price field calculation with selected checkbox items

      Post

           Hello 

           I need an advise to make calculation for price field in my invoicing program

           I want to make auto calculation field which sum up of selected items in the checkbox.

           There is a price table for each check box items as well.

           I think that each checkbox item should be assigned their price from the price table first and then started calculation. 

           But I don't have any idea at all. 

           Please refer to the attached picture.

           Thank you

           Wung

      Price_field_with_checkbox.jpg

        • 1. Re: Price field calculation with selected checkbox items
          philmodjunk

               Is the first image from a list view layout where each row is a different record in the layout's underlying table or have you shown us rows of data in a portal to a related table?

               Have you set up a single check box field with multiple values or do you have multiple fields with a single check box value each?

          • 2. Re: Price field calculation with selected checkbox items
            JeongwungJeong
            1st picture is portal rows. It is a single checkbox having multiple values. The values are changed as i selected part type. Thank you
            • 3. Re: Price field calculation with selected checkbox items
              philmodjunk

                   The simplest (not necessarily the best) solution is to use that checkbox field as one of two match fields to a table of prices. My names will differ from yours so you'll need to substitute your names for mine in the following example

                   First, your table of prices needs to be structured like this:

                   PartType ; CheckBoxValue ; Price

                   Piston     ; antifriction coat ; price for piston anti friction coat
                   Piston     ; Bar1                    ; Price for piston Bar1

                   In otherwords, each record is a price for a single unique combination of partType and checkbox value. The text in CheckBoxValue as to exactly match the defined value in your value list for that option. Both this field and the checkbox field shown in your portal must be of type text.

                   You can then set up this relationship between your table of prices and your portal's table:

                   PortalTable::PartType = Prices::PartType AND
                   PortalTable::CheckBoxesField = Prices::CheckBoxValue

                   Your Price field can then use Sum ( Prices::Price ) to auto-enter the total amount of the individual prices selected for that record in your portal. You need to set this up as an auto-enter calculation, not a calculation field. That way, future price changes to your Prices table won't alter the computed amounts from previous records.

              • 4. Re: Price field calculation with selected checkbox items
                JeongwungJeong

                     Happy New year.. Thank you for the solution. it works well. But I face another problem 

                     For the Price field summing up checked box items, I use auto-enter calculation field as your suggestion but the value is not shown at the field.

                     On the contrary, if I use calculation field, the value is shown and updated as I check the items.

                     But I have to use auto-enter calculation field not to change the calculated price in my invoice in the future.

                     As you see the picture, I made two field. One is calculation field and the other one is auto-enter calculation field.  Actually the two fields are supposed to have same valve. but auto enter calculation field does not work.

                     Do you have any solution for this??

                     Thank you

                     Wung

                      

                      

                • 5. Re: Price field calculation with selected checkbox items
                  philmodjunk

                       The auto-entered calculation should work. Did you clear the "do not replace existing value" option? You can clear this and future price changes still will not modify the calculated price.