Table of Contents

Sales Document Import Feature - Setup & Processing Guide

Overview

The Sales Document Import feature in the Linc Third Party Transactions extension enables automatic creation of Business Central Sales Orders, Sales Invoices, Credit Memos, and Return Orders from imported transaction data. This comprehensive system supports customer management, item mapping, pricing, discounts, dimensions, and automated document creation with extensive validation capabilities.

Key Components

  • Application Area: Sales
  • Transaction Types: Sales, Credit Memo, Invoice Discount, Payment
  • Supported Document Types: Order, Invoice, Credit Memo, Return Order
  • Supported Line Types: Items, G/L Accounts, Fixed Assets, Comment Lines
  • Output: Business Central Sales Documents

Prerequisites

1. Basic Business Central Setup

  • Sales & Receivables Setup configured
  • Items, Customers, G/L Accounts properly set up
  • Locations configured (if inventory items used)
  • Unit of Measure codes defined
  • Dimensions configured (if using dimension tracking)
  • Number series for customer creation (if auto-creating customers)

2. Extension Setup

  • Linc Third Party Transactions extension installed
  • Appropriate user permissions configured
  • Customer templates configured (if auto-creating customers)

Step-by-Step Setup Instructions

Step 1: Configure Third Party Setup for Sales

  1. Navigate to Third Party Setup List (Page 71112700)
  2. Create or modify setup record with the following configuration:

General Settings

  • Third Party Code: Unique identifier for your sales setup
  • Application Area: Set to Sales
  • Sales/Purchasing Document Type: Choose Order or Invoice
  • XMLPort ID: Select appropriate import XMLPort for file imports
  • No. of Header Rows: Number of header rows to skip in import files

Document Grouping Options

  • Group By - Account No.: Group transactions by customer
  • Group By - Posting Date: Group by posting date
  • Group By - Ext. Document No.: Group by external document number
  • Group By - Location Code: Group by location
  • Group By - Your Reference: Group by reference field

Customer Management

  • Get Customer/Vendor No. from: Choose between:
    • Template No. Series: Use customer template with number series
    • Transaction Account No.: Use transaction account number directly
  • Default Cust/Vendor Template: Customer template for auto-creation
  • Customer/Vendor No. Prefix: Prefix for customer numbers (when using account no.)
  • Create Third Party Mapping: Auto-create customer mappings
  • Populate Def. Cust. Dimensions: Apply default customer dimensions

Processing Options

  • Use Mapping: Enable Third Party Mappings for value translation
  • Attempt Direct Mapping: Try direct value resolution when mapping not found
  • Use Default Dimensions: Use BC default dimensions vs imported dimensions
  • Exclude Dimensions from Header: Don't apply dimensions to document header
  • Use Import Description: Use imported description vs item description
  • Ignore Zero Value Lines: Automatically archive zero-amount lines
  • Include Salesperson/Purchaser: Include salesperson on documents
  • Use Addresses from Import: Use imported shipping addresses
  • Use Resp. Center: Apply responsibility centers
  • Prices Include VAT: Handle VAT-inclusive pricing
  • Allow Neg. Unit Cost / Price: Allow negative pricing
  • Use Default Line Discount: Use BC default discounts
  • Process Calculated Disc.: Trigger discount calculations
  • Auto Assign Lot Tracking: Auto-assign lot numbers (for tracked items)

Step 2: Configure Customer Mappings (if using mappings)

If Use Mapping is enabled:

  1. Navigate to Third Party Mappings (Page 71112706)
  2. Create customer mapping records:

Customer Mappings

  • Third Party Code: Same as setup record
  • Mapping Type: Customer
  • Third Party Reference No.: External customer identifier
  • Mapping No.: Internal BC Customer No.

Step 3: Configure Item & Product Mappings

Item Mappings

  • Third Party Code: Same as setup record
  • Mapping Type: Item
  • Third Party Reference No.: External item identifier
  • Mapping No.: Internal BC Item No.
  • Variant Code: (Optional) Specific item variant
  • Unit of Measure Code: (Optional) Specific UoM
  • Split: (Optional) Percentage split for multi-item mapping

G/L Account Mappings

  • Mapping Type: G/L Account
  • Third Party Reference No.: External account code
  • Mapping No.: Internal BC G/L Account No.

Fixed Asset Mappings

  • Mapping Type: Fixed Asset
  • Third Party Reference No.: External asset code
  • Mapping No.: Internal BC Fixed Asset No.

Step 4: Configure Additional Mappings

Salesperson Mappings

  • Mapping Type: Salesperson/Purchaser
  • Third Party Reference No.: External salesperson code
  • Mapping No.: Internal BC Salesperson Code

Location Mappings

  • Mapping Type: Location
  • Third Party Reference No.: External location code
  • Mapping No.: Internal BC Location Code

Responsibility Center Mappings

  • Mapping Type: Resp. Center
  • Third Party Reference No.: External responsibility center
  • Mapping No.: Internal BC Responsibility Center Code

Dimension Mappings

  • Mapping Type: Shortcut Dimension 1 Code through Shortcut Dimension 8 Code
  • Third Party Reference No.: External dimension value
  • Mapping No.: Internal BC Dimension Value Code

Step 5: Configure Customer Templates (for auto-creation)

  1. Navigate to Configuration Templates
  2. Create customer template with:
    • Table ID: Customer (18)
    • Template Code: Enter code (use in Third Party Setup)
    • Template Name: Descriptive name
    • Configure default field values
    • Set No. Series Code field (Field ID 107) with appropriate number series

Required Data Fields for Sales Documents

Mandatory Fields

  • Application Area: Must be "Sales"
  • Transaction Type: Sales, Credit Memo, or Invoice Discount
  • Account No.: Customer number (external or BC format)
  • Line Type: Item, G/L Account, Fixed Asset, or (comment)
  • Line Type No.: Item/Account number (external or BC format)
  • Line Amount: Transaction amount
  • Ext. Document No.: External document reference
  • Transaction Date: Document and posting date
  • Document Date: Specific document date
  • Line Quantity: Item quantity (defaults to 1 if not provided)
  • Unit of Measure: Unit of measure code
  • Variant Code: Item variant
  • Location Code: Inventory location
  • Currency Code: Transaction currency
  • Salesperson/Purchaser: Sales representative
  • Payment Terms Code: Payment terms
  • Payment Method Code: Payment method
  • Your Reference: Customer reference
  • Description: Line description
  • Discount: Line discount percentage
  • Requested Date: Requested delivery date
  • Ship-to fields: Shipping address information
  • Shortcut Dimension 1-8 Code: Dimension values

Additional Sales-Specific Fields

  • Gen. Bus. Posting Group: General business posting group
  • VAT Bus. Posting Group: VAT business posting group
  • Gen. Prod. Posting Group: General product posting group
  • VAT Prod. Posting Group: VAT product posting group
  • Posting Description: Posting description
  • Work Description: Work description
  • Transaction Due Date: Due date

Processing Workflow

Step 1: Import Transaction Data

Choose your import method:

Method A: File Import (XML/Excel)

  1. Navigate to Third Party Transactions (Page 71112707)
  2. Filter to Sales application area
  3. Click Import Transactions
  4. Select your configured Third Party Setup
  5. Choose file to import

Method B: Direct API/Integration

  • Use Business Central APIs to insert records into ThirdPartyTransact_THI_LINC table

Step 2: Create Missing Customers (if needed)

  1. In Third Party Transactions page
  2. Select transactions requiring new customers
  3. Click Create Customers/Vendors action
  4. System will create customers based on setup configuration

Step 3: Validate Imported Data

  1. Select transactions to validate (or use Ctrl+A for all)
  2. Click Validate action

Validation Process

The system validates:

  • Setup Existence: Third Party Setup record exists
  • Customer Resolution: Via mapping or direct lookup or auto-creation
  • Item/Account Validation: Line type items exist and are valid
  • Dimension Validation: All dimension values exist
  • Posting Groups: All posting group combinations valid
  • Currency Validation: Currency codes exist if specified
  • Unit of Measure: Valid UoM for items
  • Location Validation: Location codes exist
  • Salesperson: Salesperson codes valid
  • Split Validation: Split percentages total 100% for multi-item mappings

Validation Results

  • Status = Checked: Transaction passed all validations
  • Status = Error: Issues found (check Error Message field)
  • Status = Ignore: Manually ignored transactions

Step 4: Create Sales Documents

  1. Filter to show validated transactions (Validation Status = "Checked")
  2. Select transactions to process
  3. Click Create Sales Documents action
  4. Confirm creation dialog

Document Creation Logic

  • Header Creation: Groups transactions based on setup configuration
  • Document Type Selection: Based on Transaction Type and Setup
    • Sales → Order or Invoice (per setup)
    • Credit Memo → Credit Memo or Return Order (per setup)
  • Customer Assignment: From validation or mapping
  • Line Creation: One or more lines per transaction (split items create multiple lines)
  • Pricing: Calculated from Line Amount and Quantity
  • Discount Application: Applied per setup configuration
  • Dimension Application: Applied to header/lines per setup
  • Address copying: Ship-to addresses if enabled
  • Status Update: Processed transactions automatically archived

Step 5: Review and Post Documents

  1. Navigate to appropriate document list:
    • Sales Orders for order-type transactions
    • Sales Invoices for invoice-type transactions
    • Sales Credit Memos for credit memo transactions
    • Sales Return Orders for return order transactions
  2. Filter by Third Party Code if needed
  3. Review documents and modify as necessary
  4. Post documents when ready

Advanced Features

Multi-Item Split Mapping

  • Configure multiple item mappings with Split percentages
  • System creates multiple lines per transaction
  • Split percentages must total 100%
  • Pricing and discounts allocated proportionally

Invoice Discount Processing

  • Transaction Type = "Invoice Discount" creates invoice discounts
  • Requires existing sales lines to apply discount to
  • Processes via BC's standard invoice discount calculation

Lot Tracking Support

  • Auto Assign Lot Tracking creates lot numbers automatically
  • Works with lot-tracked items
  • Integrates with BC's item tracking system

Customer Auto-Creation Options

Template-Based Creation

  • Uses BC Configuration Templates
  • Applies default values from template
  • Uses number series from template
  • Supports default dimension population

Account Number-Based Creation

  • Uses transaction account number directly
  • Applies optional prefix
  • Uses customer template for defaults

Dimension Handling

  • Supports all 8 shortcut dimensions
  • Can use imported values or BC defaults
  • Option to exclude from header
  • Automatic validation against dimension values

Validation Rules & Error Messages

Critical Errors (Will prevent processing)

  • "Third Party Setup for %1 was not found"
  • "No Mapped Customer Found"
  • "No Mapped Item Found"
  • "No Mapped GL Account Found"
  • "No Mapped Fixed Asset Found"
  • "No Mapped Salesperson Found"
  • "No Mapped Resp. Center Found"
  • "No Mapped Shortcut Dimension Found"
  • "Split field is %1" (when split doesn't total 100%)

Validation Failures

  • Customer existence or creation issues
  • Item/Account availability
  • Posting group combinations
  • Dimension value existence
  • Currency code validity
  • Unit of measure compatibility

Troubleshooting Guide

Common Issues & Solutions

1. "No Mapped Customer Found"

Solutions:

  • Create customer mapping in Third Party Mappings
  • Enable "Attempt Direct Mapping" if customer codes match BC
  • Use "Create Customers/Vendors" action for auto-creation
  • Check customer template configuration

2. "No Mapped Item Found"

Solutions:

  • Create item mapping in Third Party Mappings
  • Enable "Attempt Direct Mapping" if item codes match BC
  • Verify items exist in BC Item table
  • Check item variant and UoM settings

3. Split percentage errors

Solutions:

  • Ensure all split values for same item total exactly 100%
  • Check for duplicate or missing mapping records
  • Verify split field values in mapping table

4. Posting group validation failures

Solutions:

  • Verify posting group combinations exist in BC
  • Check customer posting groups
  • Validate item posting groups
  • Ensure VAT setup is complete

5. Dimension validation errors

Solutions:

  • Check dimension values exist in BC
  • Verify dimension mapping configuration
  • Consider enabling "Use Default Dimensions"
  • Check dimension restrictions

6. Customer creation failures

Solutions:

  • Verify customer template exists and is properly configured
  • Check number series in template (Field ID 107)
  • Ensure template has default values for required fields
  • Check user permissions for customer creation

7. Zero documents created

Solutions:

  • Verify transactions have "Checked" validation status
  • Check application area filter (must be "Sales")
  • Review error messages on failed transactions
  • Ensure valid transaction types (Sales, Credit Memo)

Best Practices

  1. Start Small: Test with a few transactions to verify setup
  2. Use Customer Templates: Provides consistent customer creation
  3. Configure Mappings: Better control than direct mapping alone
  4. Test Validation: Run validation before processing large batches
  5. Monitor Error Messages: Address validation errors promptly
  6. Use Grouping: Configure grouping options to avoid document fragmentation
  7. Backup Before Processing: Take database backup before large imports
  8. Review Dimensions: Ensure dimension setup is complete before import
  9. Test Pricing Logic: Verify pricing calculations with sample data
  10. Check Address Handling: Test ship-to address copying if used

Performance Considerations

  • Batch Processing: Process large imports in smaller batches
  • Customer Creation: Create customers in advance if possible
  • Validation Timing: Run validation during off-peak hours
  • Archive Management: System automatically archives processed transactions
  • Index Usage: Ensure proper filtering for optimal performance

Integration Events

The system provides integration events for customization:

  • OnBeforeCreateSalesLine: Customize before line creation
  • OnAfterUpdateThirdPartyTransactionAfterDocumentCreatedTransact: Post-processing customization
  • OnBeforeValidateLines: Custom validation logic

Security & Permissions

Required permissions for users:

  • Read/Write access to Third Party Transaction tables
  • Insert/Modify access to Sales Document tables
  • Customer creation permissions (if auto-creating)
  • Execute permissions on processing codeunits
  • Access to setup and mapping pages
  • Dimension management permissions