Skip to main content

Testing BC Export

This guide walks you through testing the Business Central export system.

Prerequisites

Before testing:

  • ✅ API Connections configured (SOAP and OData)
  • ✅ Connections tested successfully
  • ✅ Database schema updated
  • ✅ Orders imported via Order Sync

Manual Testing

Test 1: Insert Line Items

  1. Navigate to GSM Middleware → Control Panel
  2. Locate the "Business Central Export" widget
  3. Check "Pending Insert" count (should be > 0)
  4. Click "Run Insert Now"
  5. Verify result:
    ✓ Complete
    Processed: 10, Success: 10, Failed: 0

Test 2: Verify Line Items

  1. Wait 2-5 minutes (allow BC to process)
  2. Check "Pending Verify" count
  3. Click "Run Verify Now"
  4. Verify sales order numbers retrieved

Cron Testing

Test the cron scripts manually:

php wp-content/plugins/gsm-middleware/cron/bc-insert-items.php

Expected output:

[2026-03-17 12:00:00 UTC] GSM BC Insert Items starting...
Processed: 15, Success: 15, Failed: 0
[2026-03-17 12:00:08 UTC] GSM BC Insert Items complete in 8s.

Database Verification

Check that orders were processed:

SELECT number, imported, verified, nav_sales_order_number 
FROM rm_order
WHERE verified = 1
ORDER BY verified_date DESC
LIMIT 10;

Success Criteria

✅ Insert operation completes without errors
✅ Verify operation retrieves sales order numbers
✅ Database flags update correctly
✅ Orders appear in Business Central
✅ Cron jobs execute automatically

Next Steps