Skip to main content

Monitoring BC Export

Learn how to monitor Business Central export operations and track order processing status.

Control Panel Dashboard

Location: WordPress Admin → GSM Middleware → Control Panel

The BC Export widget shows real-time statistics:

  • Pending Insert: Orders waiting to be pushed to Business Central
  • Pending Verify: Orders waiting for BC confirmation

Stats auto-refresh every 30 seconds.

Database Monitoring

Check Pending Orders

SELECT 
SUM(CASE WHEN imported=0 AND verified=0 THEN 1 ELSE 0 END) as pending_insert,
SUM(CASE WHEN imported=1 AND verified=0 THEN 1 ELSE 0 END) as pending_verify,
SUM(CASE WHEN verified=1 THEN 1 ELSE 0 END) as completed
FROM rm_order
WHERE fully_import_from_website = 1;

View Recent Exports

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

Log Monitoring

Real-Time Logs

# Insert operations
tail -f /var/log/gsm-middleware/bc-insert-items.log

# Verify operations
tail -f /var/log/gsm-middleware/bc-verify-items.log

Search Logs

# Find specific order
grep "BGM-123456" /var/log/gsm-middleware/bc-insert-items.log

# Find errors
grep ERROR /var/log/gsm-middleware/bc-insert-items.log

Error Monitoring

Check BC errors:

SELECT 
order_number,
message,
created_at
FROM rm_order_import_errors
ORDER BY created_at DESC
LIMIT 20;

Performance Monitoring

Track execution times:

grep "Total execution time" /var/log/gsm-middleware/bc-insert-items.log | tail -20

Expected performance:

  • Insert 100 orders: < 60 seconds
  • Verify 100 orders: < 30 seconds

Daily Checks

  1. Check pending counts (should be low)
  2. Review error count (should be 0 or minimal)
  3. Verify orders processed today
  4. Check for stuck orders (imported but not verified > 2 hours)

Next Steps