6 Replies Latest reply on Aug 24, 2016 12:01 AM by alangodfrey

    How to select a record instead of changing it

    pschelde

      Hi, I have a challange

       

      I have created a customer table with related delivery adresses.

      See image

      Skærmbillede 2016-08-22 kl. 16.27.00.png

      Then I haver a order table witch is related to the customer table.

      See image

      Skærmbillede 2016-08-22 kl. 16.28.33.png

      The delivery adresses (Levering in danish) is related to a unique customer through an ID number.

      When I create a new order it automatically sets the delivery address to the first i the list above

      Now I change that to the next i the list - see image

      Skærmbillede 2016-08-22 kl. 16.30.12.png

      Then I changes the first on the list to "Levering 2" in stead of actually change to the next record on the list. And does not change the below fields either.

       

      Now I have two records of "Levering 2" See image

      Skærmbillede 2016-08-22 kl. 16.30.28.png

      How do I solve this.

      I have no problem doing this with Order/Customers. Does this problem show because the related records are "one more step away"?

        • 1. Re: How to select a record instead of changing it
          Mike_Mitchell

          pschelde wrote:

           

          I have no problem doing this with Order/Customers. Does this problem show because the related records are "one more step away"?

           

          No. It shows up because there's only one related record. You're changing the information on the related parent record. If you want it to be different on each line item, you'll need to move the field into that table.

          • 2. Re: How to select a record instead of changing it
            pschelde

            Hi Mike

             

            Thank you for quick reply.

             

            I'm do not understand your answer - sorry

             

            I have inserted an image of the tables. What is it that needs to be moved?. I would like to have multiple delivery adresses on a customer. That why I have made a new table for that and then related them through an unique ID number.

             

            Where do I go wrong?

             

            Skærmbillede 2016-08-23 kl. 08.30.53.png

            • 3. Re: How to select a record instead of changing it
              alangodfrey

              If the Kunder are Customers, and the Leveringssteder are Delivery Addresses, you seem to have linked the Customer Table to the Delivery Address table by the unique Customer ID.  That is great for showing you a list of all the possible Delivery Addresses for a Customer.

               

              But for any one order the Customer has placed, how does the Order know which one of the many matching Delivery Addresses to allocate to the Order?  You will need another field in the Order Table with a unique Delivery Address ID.  You can design the Order Entry layout to offer you all of the available addresses for that customer, then click on one to allocate that Delivery Address to that order.

               

              (That is meant to be the same as Mike has explained.)

              • 4. Re: How to select a record instead of changing it
                Mike_Mitchell

                alangodfrey wrote:

                 

                But for any one order the Customer has placed, how does the Order know which one of the many matching Delivery Addresses to allocate to the Order? You will need another field in the Order Table with a unique Delivery Address ID. You can design the Order Entry layout to offer you all of the available addresses for that customer, then click on one to allocate that Delivery Address to that order.

                 

                Yes, via a portal, for example. Or a drop-down list or pop-up menu.

                • 5. Re: How to select a record instead of changing it
                  pschelde

                  Thank you for replying. I don't quite understand...

                   

                  I have used Customer_ID (Kunde_ID) for linking Delivery addresses to a customer. I have done that, so that when you select delivery adresses in the order table, you only see the delivery addresses linked to that customer. But I can't get the delivery address to link to an order because I can't relate the order table twice. Does that make any sense? Can I link delivery addresses to multiple customers and orders, so I don't have to create a record of an delivery address more than once?

                   

                  I have put an image of the relationship. Can you tell mere where I need to create a new field and how I should link them. Thank you for your help.

                  Skærmbillede 2016-08-23 kl. 08.30.53.png

                  • 6. Re: How to select a record instead of changing it
                    alangodfrey

                    "But I can't get the delivery address to link to an order because I can't relate the order table twice." - you can relate tables as many times as you need to.  Check out 'anchor buoy' on this forum.

                     

                    I would suggest that you add to the Order Table another field, DeliveryID, add a (unique) DeliveryID field to the Delivery Table, then relate the Order Table to the Delivery Address table by that key.