Feature Overview
When goods are shipped in a sea container, freight and handling costs typically apply to the entire container load rather than to individual sales orders. Business Central's standard item charge mechanism assigns landed costs to specific shipment lines, but doing so for a container shipment would normally require manually identifying every sales shipment line that belongs to the container. Sales Container Handling automates this by using the container code as the linking key.
The feature works in both directions: for sales item charges (where your company is recovering freight from the customer) and for purchase item charges (where your company is recording the actual freight cost paid to the carrier). In both cases, the workflow is the same — you raise an item charge line on a sales or purchase document, open the Item Charge Assignment page, and use the Get lines with Container ID action to automatically populate the assignment lines with all the sales shipment lines that belong to the container. The system locates the relevant shipment lines by matching the container code and distributes the charge across them.
A safeguard is built in: if there are still outstanding (unshipped) sales order lines linked to the same container, the system warns you that not all goods have been shipped yet. This prevents you from closing out freight costs before all lines have been dispatched, which would result in incomplete cost allocation.
Key Facts
| Topic | Detail |
|---|---|
| Pages affected | Item Charge Assignment (Sales), Item Charge Assignment (Purch) |
| New field on assignment pages | Container Code (sales), Outbound Container Code (purchase) |
| New action — sales | Get lines with Container ID |
| New action — purchase | Get lines with Sales Container ID |
| How assignment lines are found | System filters Sales Shipment Lines by the container code on the source line |
| Outstanding line warning | If open order lines still exist for the same container, a warning message is shown |
| Container code on Item Charge Assignment (Sales) | Carried forward automatically when item charge assignment lines are copied |
| Container code on Item Charge Assignment (Purch) | Carried forward automatically when item charge assignment lines are copied |
Getting Started
- Ship all (or the relevant portion of) the lines in a container using Ship Lines on the Outbound Container Card. The container code is written to the resulting sales shipment lines.
- Create a Sales Invoice or Sales Order with an item charge line to recover freight costs from the customer, or a Purchase Invoice or Purchase Order with an item charge line to record the freight cost from the carrier.
- On the item charge line, open the Item Charge Assignment page via the line actions.
- Choose Get lines with Container ID (sales) or Get lines with Sales Container ID (purchase).
- The system finds all sales shipment lines tagged with the container code from the source line and creates assignment lines for each one automatically.
- If a warning appears about outstanding order lines, verify that all intended lines have been shipped before proceeding.
- Adjust the distribution amounts if needed and close the assignment page.
- Post the invoice to apply the item charge to item ledger entries.
Related Features
This feature depends on the Outbound Container workflow described in the Outbound Container article — the container code must be present on sales shipment lines before it can be used to drive item charge assignments. Container Measurements and Weight Tracking provides the weight and volume data that is often used to determine how a freight charge should be split across lines (e.g. by weight); however, the charge distribution itself is handled by Business Central's standard item charge proportionality logic, not by Sales Container Handling directly.
User Stories
US-01: Assign a sales item charge across all shipment lines of a container
As a Sales Order Processor
I want to use the container code to automatically populate item charge assignment lines for a sales freight charge
So that the freight cost is allocated to all the correct sales shipment lines without having to identify them manually
Setup:
- Create a Sales Invoice or add a line to a Sales Order with Type = Charge (Item) and the relevant item charge code.
- On the item charge line, open Item Charge Assignment from the line menu.
- Choose Get lines with Container ID from the Functions menu.
- The system reads the Container Code from the source sales line, finds all sales shipment lines carrying that container code, and inserts them as assignment lines.
- Review the populated lines and adjust amounts or quantities if needed.
- Close the assignment page and post the invoice.
Note: If the source sales line does not have a Container Code, the action will fail with an error. Ensure the container code is set on the item charge line's source line before running this action.
US-02: Assign a purchase item charge across all shipment lines of a container
As a Purchasing Agent
I want to use the container code on a purchase line to automatically populate item charge assignment lines
So that the freight invoice from the carrier is allocated to all the relevant sales shipment lines without manual selection
Setup:
- Create a Purchase Invoice or add a line to a Purchase Order with Type = Charge (Item) for the freight cost.
- Enter the Container Code on the purchase line in the Outbound Container Code field.
- Open Item Charge Assignment from the line menu.
- Choose Get lines with Sales Container ID from the Functions menu.
- The system locates all sales shipment lines tagged with that container code and inserts them as assignment lines.
- Review and adjust the distribution as needed.
- Post the purchase invoice.
Note: The Container Code field on the purchase line is visible only when the Sales Container Handling app is installed and enabled.
US-03: Receive a warning when outstanding order lines still exist for the container
As a Sales Order Processor
I want to be warned if I try to assign a freight charge to a container that still has unshipped lines
So that I can ensure all goods are shipped before closing out the freight cost allocation
Setup:
- Run Get lines with Container ID (or the purchase equivalent) on a container that still has open sales order lines with outstanding quantity.
- The system displays a warning message identifying the outstanding order line — showing the document type, document number, line number, and container code.
- Review the warning and decide whether to proceed or wait until all lines are shipped.
Note: The warning does not block the assignment — it is informational. You can proceed if you intentionally want to assign freight before all lines are shipped.
US-04: View the container code on item charge assignment lines
As a Sales Order Processor
I want to see which container code is associated with each item charge assignment line
So that I can verify the correct container has been used and cross-reference with the physical shipment
Setup:
- Open the Item Charge Assignment (Sales) page for any sales item charge line that has been populated via container.
- Look for the Container Code column. Add it via the column chooser if not visible.
- Each assignment line shows the container code of the shipment line it is assigned to.
US-05: View the container code on purchase item charge assignment lines
As a Purchasing Agent
I want to see the outbound container code on purchase item charge assignment lines
So that I can confirm the freight cost is being allocated to the correct outbound shipment
Setup:
- Open the Item Charge Assignment (Purch) page for a purchase item charge line assigned via container.
- Add the Outbound Container Code column via the column chooser if not visible.
- Each assignment line shows the container code linking it to the relevant sales shipment lines.
US-06: Confirm that container code is carried forward when item charge assignments are copied
As a Sales Order Processor
I want to confirm that the container code is preserved when item charge assignment lines are copied from one document to another
So that the freight allocation history remains consistent when documents are duplicated or corrected
Setup:
- Post a sales invoice that includes item charge assignments linked to a container code.
- Create a Sales Credit Memo by copying from the posted invoice.
- Open the Item Charge Assignment for the credit memo's item charge line.
- Verify that the Container Code column still shows the original container code on each assignment line.
US-07: Confirm that purchase container code is carried forward when purchase item charges are copied
As a Purchasing Agent
I want to confirm that the container code is preserved when purchase item charge assignment lines are copied
So that cost corrections and credit memos remain linked to the original container
Setup:
- Post a purchase invoice with item charge assignments linked to a container code.
- Create a Purchase Credit Memo by copying from the posted invoice.
- Open the Item Charge Assignment for the credit memo's item charge line.
- Verify that the Outbound Container Code column is populated with the original container code.
Field Reference
| Field | Where to find it | What it does | Default |
|---|---|---|---|
| Container Code | Item Charge Assignment (Sales) | Shows the container code of the shipment line the charge is assigned to; set automatically by the Get lines with Container ID action | Blank |
| Outbound Container Code | Item Charge Assignment (Purch) | Shows the container code used to find the sales shipment lines for this purchase charge; set from the purchase line | Blank |
| Outbound Container Code | Purchase Line | Container code entered on the purchase item charge line to drive the assignment lookup | Blank |
| Get lines with Container ID | Item Charge Assignment (Sales) – Functions | Finds all sales shipment lines with the matching container code and inserts them as assignment lines | Action |
| Get lines with Sales Container ID | Item Charge Assignment (Purch) – Functions | Finds all sales shipment lines with the matching container code and inserts them as assignment lines | Action |