1 Reply Latest reply on Jan 3, 2013 9:26 PM by philmodjunk

    Relationship Help



      Relationship Help


           A couple of my value lists dont seem to be working properly and I'm wondering if you could look at my relationships because i think it's where the problem lies.  Each customer can have 1 default "ShipTo" location.  If the customer wants to ship to a different location I would add an additional shipto record from the button on the Customer Layout.... then when the order is created I am showing the default shipto location but would then through the drop down list select the alternate shipto and save the id to the Order table.  I believe the join between the Shipto Table and Customer table is not correct.


        • 1. Re: Relationship Help

               going by the naming convention that you are using, you are correct. __pk stands for "primary key" and is intended to be the field that uniquely identifies each record in that table--usually auto-entered serial numbers. Thus, by the field names, __pkShipTo and __pkCustomers cannot be linked to each other in a relationship as each uniquely identifies the records in their respective tables. A relationship using = like you have must have matching values in both fields. SInce a customer can have more than one ShipTo address, you should have this relationship:

               Customers::__pkCustomerID = ShipTo::_fkCustomerID

               and linking a new record in ShipTo to a given record in Customers requires copying the __pk value into the _fk field of that new record. This can be done via a script or in a portal (if "allow creation of records..." for ShipTo is specified in the relationship.)