Purchase Document Import Feature - Setup & Processing Guide
Overview
The Purchase Document Import feature in the Linc Third Party Transactions extension enables automatic creation of Business Central Purchase Orders, Purchase Invoices, Credit Memos, and Return Orders from imported transaction data. This comprehensive system supports vendor management, item mapping, pricing, discounts, dimensions, and automated document creation with extensive validation capabilities.
Key Components
- Application Area: Purchasing
- Transaction Types: Purchase, 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 Purchase Documents
Prerequisites
1. Basic Business Central Setup
- Purchases & Payables Setup configured
- Items, Vendors, 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 vendor creation (if auto-creating vendors)
2. Extension Setup
- Linc Third Party Transactions extension installed
- Appropriate user permissions configured
- Vendor templates configured (if auto-creating vendors)
Step-by-Step Setup Instructions
Step 1: Configure Third Party Setup for Purchasing
- Navigate to Third Party Setup List (Page 71112700)
- Create or modify setup record with the following configuration:
General Settings
- Third Party Code: Unique identifier for your purchase setup
- Application Area: Set to
Purchasing - Sales/Purchasing Document Type: Choose
OrderorInvoice - 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 vendor
- Group By - Posting Date: Group by posting date
- Group By - Ext. Document No.: Group by external document number (vendor invoice/credit memo no.)
- Group By - Location Code: Group by location
- Group By - Your Reference: Group by reference field
Vendor Management
- Get Customer/Vendor No. from: Choose between:
Template No. Series: Use vendor template with number seriesTransaction Account No.: Use transaction account number directly
- Default Cust/Vendor Template: Vendor template for auto-creation
- Customer/Vendor No. Prefix: Prefix for vendor numbers (when using account no.)
- Create Third Party Mapping: Auto-create vendor mappings
- Populate Def. Cust. Dimensions: Apply default vendor 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 purchaser on documents
- Use Resp. Center: Apply responsibility centers
- Use Due Date from Import: Use imported due dates
- 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
Step 2: Configure Vendor Mappings (if using mappings)
If Use Mapping is enabled:
- Navigate to Third Party Mappings (Page 71112706)
- Create vendor mapping records:
Vendor Mappings
- Third Party Code: Same as setup record
- Mapping Type:
Vendor - Third Party Reference No.: External vendor identifier
- Mapping No.: Internal BC Vendor 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
Purchaser Mappings
- Mapping Type:
Salesperson/Purchaser - Third Party Reference No.: External purchaser code
- Mapping No.: Internal BC Purchaser 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 CodethroughShortcut Dimension 8 Code - Third Party Reference No.: External dimension value
- Mapping No.: Internal BC Dimension Value Code
Fixed Asset Maintenance Mappings
- Mapping Type:
FA Maintenance - Third Party Reference No.: External maintenance code
- Mapping No.: Internal BC FA Maintenance Code
Step 5: Configure Vendor Templates (for auto-creation)
- Navigate to Configuration Templates
- Create vendor template with:
- Table ID: Vendor (23)
- 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 Purchase Documents
Mandatory Fields
- Application Area: Must be "Purchasing"
- Transaction Type:
Purchase,Credit Memo, orInvoice Discount - Account No.: Vendor 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
Optional but Recommended Fields
- Ext. Document No.: External document reference (vendor invoice/credit memo number)
- Transaction Date: Document and posting date
- Document Date: Specific document date
- Transaction Due Date: Due date for payment
- 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: Purchaser code
- Payment Terms Code: Payment terms
- Payment Method Code: Payment method
- Your Reference: Your internal reference
- Payment Reference: Payment reference
- Description: Line description
- Discount: Line discount percentage
- Requested Date: Requested receipt date
- Shortcut Dimension 1-8 Code: Dimension values
Additional Purchase-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
- FA Maint. Code: Fixed asset maintenance code (for FA transactions)
Processing Workflow
Step 1: Import Transaction Data
Choose your import method:
Method A: File Import (XML/Excel)
- Navigate to Third Party Transactions (Page 71112707)
- Filter to Purchasing application area
- Click Import Transactions
- Select your configured Third Party Setup
- Choose file to import
Method B: Direct API/Integration
- Use Business Central APIs to insert records into
ThirdPartyTransact_THI_LINCtable
Step 2: Create Missing Vendors (if needed)
- In Third Party Transactions page
- Select transactions requiring new vendors
- Click Create Customers/Vendors action
- System will create vendors based on setup configuration
Step 3: Validate Imported Data
- Select transactions to validate (or use Ctrl+A for all)
- Click Validate action
Validation Process
The system validates:
- Setup Existence: Third Party Setup record exists
- Vendor 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
- Purchaser: Purchaser codes valid
- Split Validation: Split percentages total 100% for multi-item mappings
- FA Maintenance: Fixed asset maintenance codes valid
Validation Results
- Status = Checked: Transaction passed all validations
- Status = Error: Issues found (check Error Message field)
- Status = Ignore: Manually ignored transactions
Step 4: Create Purchase Documents
- Filter to show validated transactions (Validation Status = "Checked")
- Select transactions to process
- Click Create Purchase Documents action
- Confirm creation dialog
Document Creation Logic
- Header Creation: Groups transactions based on setup configuration
- Document Type Selection: Based on Transaction Type and Setup
- Purchase → Order or Invoice (per setup)
- Credit Memo → Credit Memo or Return Order (per setup)
- Vendor 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
- External Document Numbers:
- Purchase documents: Vendor Invoice No.
- Credit documents: Vendor Cr. Memo No.
- Status Update: Processed transactions automatically archived
Step 5: Review and Post Documents
- Navigate to appropriate document list:
- Purchase Orders for order-type transactions
- Purchase Invoices for invoice-type transactions
- Purchase Credit Memos for credit memo transactions
- Purchase Return Orders for return order transactions
- Filter by Third Party Code if needed
- Review documents and modify as necessary
- 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 purchase lines to apply discount to
- Processes via BC's standard invoice discount calculation
Vendor 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 vendor 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
Fixed Asset Support
- Full support for fixed asset transactions
- Fixed asset maintenance code mapping
- Proper disposal and acquisition handling
Credit Memo Processing
- Automatic quantity sign reversal for credit memos
- Proper handling of positive and negative quantities
- Support for both credit memo and return order types
Validation Rules & Error Messages
Critical Errors (Will prevent processing)
"Third Party Setup for %1 was not found""No Mapped Vendor Found""No Mapped Item Found""No Mapped GL Account Found""No Mapped Fixed Asset Found""No Mapped FA Maintenance Code Found""No Mapped Purchaser Code Found""No Mapped Resp. Center Found""No Mapped Shortcut Dimension Found""Split field is %1"(when split doesn't total 100%)
Processing Validations
"Purchase Line has already been received"(prevents modification of received lines)- Vendor 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 Vendor Found"
Solutions:
- Create vendor mapping in Third Party Mappings
- Enable "Attempt Direct Mapping" if vendor codes match BC
- Use "Create Customers/Vendors" action for auto-creation
- Check vendor 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. "Purchase Line has already been received"
Solutions:
- Cannot add lines to purchase documents with received quantities
- Create a new purchase document for additional lines
- Check document status before processing
4. 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
5. Fixed asset maintenance errors
Solutions:
- Create FA maintenance mappings if using mapped values
- Verify maintenance codes exist in BC
- Check fixed asset posting type setup
6. Vendor creation failures
Solutions:
- Verify vendor 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 vendor creation
7. External document number conflicts
Solutions:
- Ensure vendor invoice numbers are unique per vendor
- Check document grouping settings
- Review external document number field mapping
8. Zero documents created
Solutions:
- Verify transactions have "Checked" validation status
- Check application area filter (must be "Purchasing")
- Review error messages on failed transactions
- Ensure valid transaction types (Purchase, Credit Memo)
Best Practices
- Start Small: Test with a few transactions to verify setup
- Use Vendor Templates: Provides consistent vendor creation
- Configure Mappings: Better control than direct mapping alone
- Test Validation: Run validation before processing large batches
- Monitor Error Messages: Address validation errors promptly
- Use Grouping: Configure grouping options to avoid document fragmentation
- Backup Before Processing: Take database backup before large imports
- Review Dimensions: Ensure dimension setup is complete before import
- Test Pricing Logic: Verify pricing calculations with sample data
- Handle External Documents: Ensure proper external document number handling
- Check Receipt Dates: Configure receipt date handling appropriately
- Validate Maintenance Codes: For fixed assets, ensure maintenance mapping is correct
Performance Considerations
- Batch Processing: Process large imports in smaller batches
- Vendor Creation: Create vendors 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:
OnBeforeCreatePurchLine: Customize before line creationOnBeforeValidateLines: Custom validation logic
Security & Permissions
Required permissions for users:
- Read/Write access to Third Party Transaction tables
- Insert/Modify access to Purchase Document tables
- Vendor creation permissions (if auto-creating)
- Execute permissions on processing codeunits
- Access to setup and mapping pages
- Dimension management permissions