EDI Integration with TrueCommerce
This document describes the Electronic Data Interchange (EDI) integration between Business Central and TrueCommerce for automated electronic document exchange with trading partners.
Overview
The Texas Star Nuts extension integrates with TrueCommerce EDI and eCommerce (v9.0.0.0) to enable:
- Advanced Shipping Notices (ASN) - 856 EDI transaction
- Electronic Purchase Orders - 850 EDI transaction
- Invoices - 810 EDI transaction
- Functional Acknowledgments - 997 EDI transaction
The primary focus of custom integration is ASN (Advanced Shipping Notice) transmission when warehouse shipments are posted.
TrueCommerce Field Mapping
Overview of TRC Fields
TrueCommerce uses fields prefixed with “TRC” on Business Central tables to capture data for EDI transmission. The Texas Star extension automatically synchronizes data to these fields.
Field Mapping Reference
| Business Central Field |
TRC EDI Field |
Purpose |
EDI Segment |
| Bill of Lading No. |
TRCBillofLading |
BOL number |
HL/TD3 |
| Bill of Lading No. |
TRCUDF2 |
BOL backup |
UDF segment |
| Seal No. |
TRCUDF3 |
Trailer seal number |
AT7 |
| Trailer Reference |
TRCTrailerNumber |
Trailer number |
AT7 |
| Trailer Reference |
TRCCarrierPro |
Carrier PRO/tracking |
AT7 |
| Shipping Agent Code |
TRCUDF5 |
Carrier SCAC code |
AT7/TD5 |
| - |
TRCUDF4 |
ARN (Authorization Return Number) |
REF |
| TRCASNType |
TRCASNType |
ASN type (Pick & Pack vs Pallet) |
BSN/HL |
Field Synchronization Logic
1. Bill of Lading Number
Source: Warehouse Shipment Header - Bill of Lading No.
Target TRC Fields:
Synchronization Timing:
- Initial: When warehouse shipment created
- Updates: Any modification to Bill of Lading No.
Code:
WarehouseShipmentHeader.TRCBillofLading := WarehouseShipmentHeader."Bill of Lading No.";
WarehouseShipmentHeader.TRCUDF2 := WarehouseShipmentHeader."Bill of Lading No.";
EDI Usage:
- Appears on ASN as BOL identifier
- Used by customer receiving systems for shipment tracking
- Critical for matching ASN to physical shipment
Code Reference: TSNEventSubscriber.Codeunit.al
2. Seal Number
Source: Warehouse Shipment Header - Seal No.
Target TRC Field: TRCUDF3
Synchronization Timing:
- On modification of warehouse shipment header
- Before posting shipment
Code:
if WarehouseShipmentHeader."Seal No." <> '' then
WarehouseShipmentHeader.TRCUDF3 := WarehouseShipmentHeader."Seal No.";
EDI Usage:
- Transmitted in ASN AT7 segment
- Seal number verifies trailer security
- Customer verifies seal integrity upon receipt
Business Process:
- Warehouse team closes and seals trailer
- Seal number recorded in warehouse shipment
- Field synced to TRCUDF3
- ASN transmitted with seal number
- Customer verifies seal upon delivery
Code Reference: TSNWarehouseShipmentHeader.TableExt.al
3. Trailer Reference
Source: Warehouse Shipment Header - Trailer Reference
Target TRC Fields:
- TRCTrailerNumber
- TRCCarrierPro
Synchronization Timing:
- On modification of warehouse shipment header
- Before posting shipment
Code:
if WarehouseShipmentHeader."Trailer Reference" <> '' then begin
WarehouseShipmentHeader.TRCTrailerNumber := WarehouseShipmentHeader."Trailer Reference";
WarehouseShipmentHeader.TRCCarrierPro := WarehouseShipmentHeader."Trailer Reference";
end;
EDI Usage:
- Transmitted in ASN AT7 segment
- Carrier tracking number or trailer ID
- Used for freight tracking
Typical Values:
- Trailer Number: TRLR-12345
- PRO Number: 123456789
- Container Number: CONT-ABC-001
Code Reference: TSNEventSubscriber.Codeunit.al
4. Shipping Agent Code
Source: Warehouse Shipment Header - Shipping Agent Code
Target TRC Field: TRCUDF5
Synchronization Timing:
- On modification of warehouse shipment header
- Before posting shipment
- Recent enhancement: Synced when seal no. is updated (per git commit history)
Code:
if WarehouseShipmentHeader."Shipping Agent Code" <> '' then
WarehouseShipmentHeader.TRCUDF5 := WarehouseShipmentHeader."Shipping Agent Code";
EDI Usage:
- Transmitted in ASN TD5 segment
- SCAC (Standard Carrier Alpha Code) for carrier
- Used for routing and freight charges
Common SCAC Codes:
- FEDX - FedEx
- UPGF - UPS Ground Freight
- RDWY - YRC Freight
- ODFL - Old Dominion
Business Impact:
- Customer routes shipment internally
- Freight payment/audit
- Delivery scheduling
Code Reference: TSNEventSubscriber.Codeunit.al
5. ASN Type
Source: Sales Header - TRCASNType
Values:
- Pick and Pack - Small orders (≤25 units)
- Pallet Pick and Pack - Large orders (>25 units)
Determination Logic:
if SalesHeader."TSN Total Quantity" > 25 then
SalesHeader.TRCASNType := SalesHeader.TRCASNType::"Pallet Pick and Pack"
else
SalesHeader.TRCASNType := SalesHeader.TRCASNType::"Pick and Pack";
Synchronization Timing:
- When warehouse shipment line inserted
- Recalculated if lines change
EDI Usage:
- Determines ASN message structure
- Affects HL (Hierarchical Level) segment structure
- Influences customer receiving process
Pick and Pack ASN:
- Line-item level detail
- Each item listed separately
- Case-level tracking
Pallet Pick and Pack ASN:
- Pallet-level hierarchy
- HL segment includes pallet as parent
- Items grouped by pallet
- SSCC (Serial Shipping Container Code) for pallets
Business Impact:
- Pick and Pack: Customer receives into individual locations
- Pallet Pick and Pack: Customer receives entire pallets, may cross-dock
Code Reference: TSNWarehouseShipmentHeader.TableExt.al
ASN (Advanced Shipping Notice) Workflow
1. Order Processing
- Customer places order (EDI 850 or manual entry)
- Sales order created in Business Central
- Order released to warehouse
2. Warehouse Shipment Creation
- Warehouse shipment created from released order
- Bill of Lading number automatically generated
- BOL synced to TRCBillofLading and TRCUDF2
- ASN type determined based on quantity
3. Pre-Shipment Data Entry
- Warehouse team enters:
- Seal No. → synced to TRCUDF3
- Trailer Reference → synced to TRCTrailerNumber, TRCCarrierPro
- Shipping Agent Code → synced to TRCUDF5
- All fields synchronized to TRC fields via event subscribers
4. Picking Process
- Pick created with lot numbers selected by FEFO + shelf life
- Pick registered
- Lot numbers recorded on shipment lines
- Weight/volume calculated from shipment lines
5. Shipment Posting
- Trigger: Post warehouse shipment
- TrueCommerce Integration:
- System reads TRC fields from posted warehouse shipment
- Retrieves lot numbers, quantities, item details
- Builds 856 EDI ASN message
- Transmits ASN to trading partner via TrueCommerce network
6. ASN Transmission
- ASN sent electronically to customer
- Customer receiving system imports ASN
- Customer prepares to receive shipment
7. Customer Receipt
- Physical shipment arrives
- Customer verifies:
- Bill of Lading matches ASN
- Seal number intact
- Contents match ASN line items
- Shipment received into customer system
ASN Data Elements
- Transaction Set Purpose Code: 00 = Original
- Shipment Identification: Bill of Lading No.
- Date: Shipment date
- Time: Shipment time
Shipment/Order Level (HL Segment)
- Order Number: Sales order number
- Purchase Order Number: Customer PO number
- ASN Type: Pick & Pack or Pallet Pick & Pack
Carrier Level (TD3/TD5 Segments)
- Carrier SCAC: Shipping Agent Code (from TRCUDF5)
- Trailer Number: From TRCTrailerNumber
- Seal Number: From TRCUDF3
Item Level (LIN/SN1/PID Segments)
- Item Number: Customer item number or UPC
- Quantity Shipped: From shipment line
- Unit of Measure: EA (each), CS (case), PLT (pallet)
- Lot Number: From item tracking
- Item Description: From item master
Pallet Level (HL/MAN Segments - Pallet Pick & Pack only)
- SSCC: Serial Shipping Container Code (license plate)
- Pallet Count: From TSN Manual Pallets or Total Pallets
- Gross Weight: From line weight totals
EDI Setup Requirements
TrueCommerce Configuration
1. Trading Partner Setup
- Configure customer as trading partner in TrueCommerce
- Set customer EDI requirements:
- ASN required (yes/no)
- Item number format (customer item no., UPC, GTIN)
- Unit of measure preferences
- Pallet/case requirements
2. Document Mapping
- Map Business Central fields to EDI segments
- Configure TRC field usage
- Set up custom UDF fields (TRCUDF1-5)
3. Communication Method
- AS2 (secure internet)
- VAN (Value Added Network)
- Direct connection
4. Testing
- Send test ASN to customer
- Verify customer can receive and process
- Validate field mappings
- Test error scenarios
Business Central Configuration
1. Warehouse Setup
- Configure BOL number series
- Set up shipping agents with SCAC codes
2. Customer Setup
- Set TrueCommerce EDI flag
- Configure customer-specific EDI requirements
- Set up customer item numbers (TSN Item Customer table)
3. Item Setup
- Ensure items have proper unit of measure codes
- Configure UPC/GTIN if required by customer
- Set up item tracking for lot-tracked items
Weight and Volume Tracking
Purpose
ASN transmission includes weight and volume for:
- Freight calculation
- Customer receiving capacity planning
- Warehouse efficiency metrics
Data Source
Warehouse Shipment Line Fields:
- TRCUDF6: Line weight
- TRCUDF7: Line volume/cubage
Calculation:
- Weight: Item Net Weight × Quantity
- Volume: Item Cubage × Quantity
Aggregation:
Total weight and volume rolled up to shipment header for ASN transmission.
EDI Usage
Transmitted in TD1 segment of ASN:
- Lading Quantity: Number of pallets/cases
- Weight: Total net weight
- Weight Qualifier: N = Net weight
- Volume: Total cubic feet/meters
- Volume Unit: CF = Cubic feet
Pallet Tracking
Manual Pallets vs. Total Pallets
Manual Pallets:
- User-entered count
- Used when pallet count known before shipment
- Override system calculation
Total Pallets:
- Flow field calculated from lines
- Automatic count based on license plates or line quantities
- Used if manual pallets not entered
License Plate Integration
Warehouse Insight Integration:
- License plates represent physical pallets
- Each license plate has SSCC (Serial Shipping Container Code)
- SSCC transmitted in ASN for pallet identification
ASN Structure with License Plates:
Shipment (HL01)
Order (HL02)
Pallet 1 - SSCC: 00012345678901234567 (HL03)
Item A - 10 cases (HL04)
Item B - 5 cases (HL04)
Pallet 2 - SSCC: 00012345678901234568 (HL03)
Item C - 20 cases (HL04)
Troubleshooting EDI Issues
Issue: ASN Not Transmitted
Possible Causes:
- TRC fields not populated
- Customer not set up as EDI trading partner
- TrueCommerce integration not active
Solution:
- Verify all TRC fields populated before posting:
- TRCBillofLading
- TRCUDF2 (BOL)
- TRCUDF3 (Seal)
- TRCTrailerNumber (Trailer)
- TRCUDF5 (Shipping Agent)
- Check customer EDI setup in TrueCommerce
- Verify TrueCommerce service is running
- Review TrueCommerce error logs
Issue: Customer Rejects ASN
Possible Causes:
- Field mapping mismatch
- Item number not recognized
- UOM (Unit of Measure) not accepted
- Missing required fields
Solution:
- Review customer EDI requirements document
- Validate item number format (customer item no. vs. UPC)
- Check UOM code matches customer expectations
- Ensure all customer-required fields populated
- Request ASN rejection reason from customer
Issue: BOL Number Not Syncing
Symptom: TRCBillofLading or TRCUDF2 empty after shipment creation
Cause: Number series not configured or event subscriber not firing
Solution:
- Verify BOL number series configured in Warehouse Setup
- Check “Bill of Lading No.” populated on warehouse shipment header
- Verify TSN Event Subscriber codeunit published
- Test event subscriber with debug/log
Issue: Seal Number Not in ASN
Symptom: Customer reports seal number missing from ASN
Cause: Seal No. not entered before posting or TRCUDF3 not syncing
Solution:
- Always enter Seal No. before posting shipment
- Verify TRCUDF3 populated when Seal No. entered
- Check event subscriber:
OnBeforeWhseShptHeaderModify
- Ensure TrueCommerce maps TRCUDF3 to AT7 segment
Issue: Wrong ASN Type Sent
Symptom: Customer expects pallet-level ASN but receives line-item level
Cause: ASN type determination threshold mismatch
Solution:
- Review current threshold (25 units)
- Verify “TSN Total Quantity” calculation on sales order
- Adjust threshold in code if customer requirements differ
- Consider customer-specific ASN type override
Best Practices
1. Pre-Shipment Validation
- Checklist before posting:
2. Customer-Specific Requirements
- Maintain documentation of each customer’s EDI requirements
- Configure customer item numbers for all trading partners
- Test ASN transmission before production shipments
- Monitor ASN acceptance rates by customer
3. Data Quality
- Ensure shipping agent codes match customer SCAC expectations
- Use consistent trailer number formats
- Validate seal numbers entered correctly
- Verify BOL numbers are unique
4. Error Monitoring
- Regularly review TrueCommerce error logs
- Investigate ASN rejections promptly
- Maintain audit trail of ASN transmissions
- Track ASN acceptance rates
5. Training
- Train warehouse staff on EDI field importance
- Emphasize seal number recording
- Explain impact of missing/incorrect data on customer
- Review ASN transmission process with team
Integration Architecture
Business Central
↓
├─ Warehouse Shipment (with TRC fields)
↓
├─ Event Subscribers (field sync)
↓
├─ Post Warehouse Shipment
↓
TrueCommerce Extension
↓
├─ Read TRC fields
├─ Build 856 ASN message
├─ Apply customer-specific mapping
↓
TrueCommerce Network
↓
├─ Transmit via AS2/VAN
↓
Customer EDI System
↓
└─ Receive and process ASN
Summary
The EDI integration with TrueCommerce provides:
- Automated ASN Transmission: Electronic advance notice of shipments
- Field Synchronization: Automatic mapping of BC data to EDI fields
- ASN Type Intelligence: Automatic determination of pick & pack method
- Comprehensive Data: BOL, seal, trailer, carrier, lot tracking
- Customer Satisfaction: Accurate advance shipment information
- Operational Efficiency: Eliminates manual ASN creation
- Compliance: Meets trading partner EDI requirements
Key Benefits
- Faster customer receiving (ASN provides advance notice)
- Reduced receiving errors (data verified against ASN)
- Improved freight tracking (carrier and trailer info)
- Enhanced traceability (lot numbers in ASN)
- Automated communication (no manual faxing/emailing)
See Also: