1 Reply Latest reply on Feb 11, 2014 3:20 PM by philmodjunk

    Addresses - Franchise

    JoseGarcia

      Title

      Addresses - Franchise

      Post

           I'm trying to solve the problem with many addresses for one client. Yes, I already have an address table and I can have many addresses for one client. The problem comes when I try to link the Sales Order to an existing client address, since this client will have a different shipping address (branches) and one billing address (headquarter). 

           How can I link and be able to select two different addresses in one layout (Sales Order) and have them fill out the correct address info, such as street, zip code, etc. This will help me out also later when I want to track shipments with locations. 

           Any suggestions is highly appreciated.

        • 1. Re: Addresses - Franchise
          philmodjunk

               Presumably, you have this relationship:

               Clients::__pkClientID = Addresses::_fkClientID

               Though your names may be different.

               Define a primary key field: __pkAddressID in Addresses. An auto-entered serial number is still the best option to use in nearly all cases.

               Then define this relationship:

               SalesOrder::_fkAddressID = Address|Selected::__pkAddressID   where Address|Selected is the name of a new Tutorial: What are Table Occurrences? of Addresses.

               Then linking your SalesOrder to a specific Address for the client becomes a matter of assigning the correct value to SalesOrder::_fkAddressID.

               One way to do that is to place a portal to Addresses on your SalesOrder layout and put a button in the portal row that does this:

               Set Field [ SalesOrder::_fkAddressID ; Address::__pkAddressID ]

               After clicking that button, fields from Address|Selected will show the correct address data for the selected address.