Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Combining/Consolidating line items from multiple orders into one shipment

Featured Replies

I'm working with a database that has a straightforward one to many relationship for customers, orders, line items and shipments.

 

The structure in place is :

 

Customers => Orders => Line item <= Shipments

Shipments are created from the order records and tagged accordingly with the unique identifier for the order. Unshipped line items from that order are visible via portal on the shipment record. As they are added to that shipment they are in turn tagged with the unique identifier for the shipment. 

 

This works great and without issue. However, we have recently had several requests, from customers who have multiple open orders, to consolidate all the unshipped items across their various orders into one shipment. 

 

Is there a way to do this without also consolidating the order records into one? For record keeping purposes, I would prefer to keep the individual orders unique.

Solved by Wim Decorte

Go to solution

you'll need a new join table between orders and shipments because now you have a many-to-many relationship between orders and shipments

  • Author

Hi Wim, 

 

Thanks for the reply. If I set up a many-to-many relationship between orders and shipments, what is the breakdown for the primary and foreign key relationships?

 

Right now, my set up is _pkOrderID => __fkShipmentID

 

How do I alter the __fkShipmentID field so that can belong to multiple orders? Is it as simple as tagging the various orders with the shipping record id instead of the inverse? Or do I need to establish a new field? 

 

Thank you.

  • Solution

You need to add a new table, call it JoinOrdersShipments (JOS)

 

The relationship then goes like this:

 

 

 


 

 


ORDERS          JOS              SHIPMENTS    
-----------------------------------------------
               _pkJosID
_pkOrderID ==> _fkOrderID
               _fkShipmentID <== _pkShipmentID

 

 

 

As a side note:

In your post you mention a relationship between _pkOrderID and __fkShipmentID, that's not the right way to do it.  I would have expected a relationship between _pkOrderID in Orders and _fkOrderID in Shipments.

  • Author

Thanks, Win. I'll give it a shot.

 

You're side note is correct. That is how I have it set up not as I previously wrote. 

 

I'll let you know how it goes.

  • 5 weeks later...
  • Author

I just wanted to follow up and say that everything worked out perfectly. It took me a little bit to figure out how to manage the lineitems so that I could still split the order contents across shipments but it is all working fine now.

 

Thank you so much for the help.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.