Business Central Integration - Technical Specification
Microsoft Business Central ERP synchronization system
Purpose
The Business Central Integration module manages bidirectional data synchronization between the Case Clinical platform and Microsoft Business Central ERP. It handles the synchronization of vendors, customers (case accounts), journal entries, purchase invoices, and financial transactions. The integration ensures financial data integrity, automates accounting processes, and provides real-time financial visibility across both systems.
Key Concepts
| Term | Definition |
|---|---|
| Business Central (BC) | Microsoft ERP system for financial management |
| Sync Job | Scheduled or triggered synchronization task |
| Sync Direction | One-way or bidirectional data flow |
| Master System | System of record for specific data |
| Sync Queue | Pending synchronization transactions |
| Sync Conflict | Data mismatch between systems |
| BC Entity | Business Central data object (Customer, Vendor, etc.) |
| Field Mapping | Translation between system fields |
| Sync Frequency | How often synchronization occurs |
| Webhook | Real-time event notification from BC |
User Roles
| Role | Description | Permissions |
|---|---|---|
| Integration Administrator | Manages integration configuration | Full access |
| Financial Controller | Monitors sync status | Read, Manual sync |
| System Administrator | Technical configuration | All permissions |
| Accounting Manager | Reviews sync errors | Read, Resolve conflicts |
| IT Support | Troubleshoots issues | Read, Restart jobs |
| Auditor | Reviews sync logs | Read only |
Field Documentation - BC Sync Configuration Entity
| Field Name | Type | Required | Description | Validation Rules | Related Entity |
|---|---|---|---|---|---|
| ID | String | Yes | Configuration ID | Auto-generated | Primary Key |
| Config Name | String | Yes | Configuration identifier | Unique, max 100 chars | - |
| Entity Type | String | Yes | Type being synced | Enum: Vendor, Customer, Journal, Invoice, Payment | - |
| Sync Direction | String | Yes | Data flow direction | Enum: To BC, From BC, Bidirectional | - |
| Master System | String | Yes | System of record | Enum: Case Clinical, Business Central | - |
| Sync Enabled | Boolean | Yes | Is sync active | Default true | - |
| Sync Frequency | String | Yes | How often to sync | Enum: Real-time, Every 5 min, Hourly, Daily | - |
| Last Sync Time | DateTime | No | Last successful sync | Updated on sync | - |
| Next Sync Time | DateTime | No | Next scheduled sync | Calculated field | - |
| Batch Size | Integer | Yes | Records per sync | 1-1000, default 100 | - |
| Retry Attempts | Integer | Yes | Failed sync retries | 0-5, default 3 | - |
| Retry Delay Minutes | Integer | Yes | Wait between retries | 1-60, default 5 | - |
| Error Threshold | Integer | Yes | Errors before alert | 1-100, default 10 | - |
| Field Mappings | Text | Yes | JSON field map | Valid JSON | - |
| Filter Criteria | Text | No | Records to sync | OData filter | - |
| Transform Rules | Text | No | Data transformation | JSON rules | - |
| Webhook URL | String | No | BC webhook endpoint | Valid URL | - |
| API Endpoint | String | Yes | BC API URL | Valid URL | - |
| Active | Boolean | Yes | Config active | Default true | - |
Field Documentation - BC Sync Log Entity
| Field Name | Type | Required | Description | Validation Rules | Related Entity |
|---|---|---|---|---|---|
| ID | String | Yes | Log entry ID | Auto-generated | Primary Key |
| Sync Config | BCSyncConfig | Yes | Configuration used | Valid config | BCSyncConfig |
| Sync Type | String | Yes | Type of sync | Enum: Scheduled, Manual, Webhook, Retry | - |
| Sync Direction | String | Yes | Direction of sync | From config | - |
| Start Time | DateTime | Yes | Sync start | Auto-set | - |
| End Time | DateTime | No | Sync completion | Set on complete | - |
| Duration Seconds | Integer | No | Time taken | Calculated | - |
| Records Processed | Integer | Yes | Total processed | >= 0 | - |
| Records Synced | Integer | Yes | Successfully synced | >= 0 | - |
| Records Failed | Integer | Yes | Failed records | >= 0 | - |
| Records Skipped | Integer | Yes | Skipped records | >= 0 | - |
| Status | String | Yes | Sync status | Enum: Running, Completed, Failed, Partial | - |
| Error Message | Text | No | Error details | If failed | - |
| Initiated By | User | No | Who started sync | Valid user ID | User |
Field Documentation - BC Vendor Sync Entity
| Field Name | Type | Required | Description | Validation Rules | Related Entity |
|---|---|---|---|---|---|
| ID | String | Yes | Sync record ID | Auto-generated | Primary Key |
| Vendor | Vendor | Yes | Case Clinical vendor | Must exist | Vendor |
| BC Vendor Number | String | Yes | BC vendor ID | From BC | - |
| BC Vendor Name | String | Yes | Name in BC | Max 100 chars | - |
| Tax ID | String | Yes | Federal Tax ID | Must match | - |
| Sync Status | String | Yes | Current status | Enum: Pending, Synced, Error, Conflict | - |
| Last Sync | DateTime | No | Last sync time | Auto-updated | - |
| Sync Direction | String | Yes | Last sync direction | To BC or From BC | - |
| BC Payment Terms | String | No | Payment terms in BC | From BC | - |
| BC Payment Method | String | No | Payment method | From BC | - |
| BC Blocked | Boolean | Yes | Blocked in BC | Default false | - |
| BC Currency Code | String | No | Currency in BC | Default USD | - |
| Field Differences | Text | No | Mismatched fields | JSON array | - |
Field Documentation - BC Customer Sync Entity
| Field Name | Type | Required | Description | Validation Rules | Related Entity |
|---|---|---|---|---|---|
| ID | String | Yes | Sync record ID | Auto-generated | Primary Key |
| Case Account | CaseAccount | Yes | Case account | Must exist | CaseAccount |
| BC Customer Number | String | Yes | BC customer ID | From BC | - |
| BC Customer Name | String | Yes | Name in BC | Patient name + case | - |
| Sync Status | String | Yes | Current status | Enum: Pending, Synced, Error | - |
| Last Sync | DateTime | No | Last sync time | Auto-updated | - |
| BC Balance | Decimal | No | AR balance in BC | From BC | - |
| BC Credit Limit | Decimal | No | Credit limit in BC | From BC | - |
| BC Payment Terms | String | No | Terms in BC | From BC | - |
| BC Blocked | Boolean | Yes | Blocked in BC | Default false | - |
Field Documentation - BC Journal Sync Entity
| Field Name | Type | Required | Description | Validation Rules | Related Entity |
|---|---|---|---|---|---|
| ID | String | Yes | Sync record ID | Auto-generated | Primary Key |
| Journal Entry | JournalEntry | Yes | Source journal | Must exist | JournalEntry |
| BC Document Number | String | No | BC document ID | From BC | - |
| BC Batch Name | String | Yes | Journal batch | From template | - |
| BC Template Name | String | Yes | Journal template | From config | - |
| Posting Date | DateTime | Yes | GL posting date | From journal | - |
| Total Amount | Decimal | Yes | Journal total | Must balance | - |
| Line Count | Integer | Yes | Number of lines | > 0 | - |
| Posted In BC | Boolean | Yes | Posted status | Default false | - |
| Posted Date | DateTime | No | When posted | From BC | - |
| Sync Status | String | Yes | Current status | Enum: Pending, Synced, Error | - |
| Error Details | Text | No | Sync errors | If failed | - |
Workflows
Initial Setup Workflow
-
Connection Configuration
- Configure BC API endpoint
- Set up authentication
- Test connection
- Verify permissions
-
Entity Mapping
- Map Case Clinical fields to BC
- Define transformation rules
- Set default values
- Configure validation
-
Sync Rules
- Define master system per entity
- Set sync frequency
- Configure batch sizes
- Set up error handling
-
Initial Data Load
- Export existing data
- Transform to BC format
- Import to BC
- Verify data integrity
Vendor Synchronization Workflow
-
Vendor Creation (Case Clinical → BC)
- New vendor created
- Add to sync queue
- Transform data
- Create in BC
- Store BC vendor number
- Update sync status
-
Vendor Update (Bidirectional)
- Detect changes
- Compare timestamps
- Determine master record
- Apply changes
- Log sync activity
-
Conflict Resolution
- Identify conflicts
- Apply resolution rules
- Manual review if needed
- Update both systems
- Document resolution
Journal Entry Sync Workflow
-
Journal Creation
- Journal approved in Case Clinical
- Add to sync queue
- Map to BC format
- Validate GL accounts
-
BC Posting
- Create journal batch
- Add journal lines
- Validate in BC
- Post to GL
- Return confirmation
-
Status Update
- Receive BC confirmation
- Update journal status
- Store BC document number
- Clear from queue
Purchase Invoice Sync Workflow
-
Claim Approval
- Claim approved for payment
- Generate purchase invoice
- Add vendor invoice
- Queue for sync
-
Invoice Creation in BC
- Create purchase document
- Add invoice lines
- Apply dimensions
- Validate totals
-
Payment Processing
- Process payment in BC
- Sync payment status
- Update claim status
- Clear invoice
Error Handling Workflow
-
Error Detection
- Catch sync errors
- Log error details
- Categorize error type
- Increment retry counter
-
Retry Logic
- Wait retry delay
- Attempt resync
- Escalate if fails
- Alert on threshold
-
Manual Resolution
- Review error queue
- Identify root cause
- Fix data issues
- Reprocess records
Business Rules
Sync Rules
- Master system determines truth
- Newer timestamp wins conflicts
- Sync only active records
- Validate before syncing
- Roll back on batch failure
Vendor Rules
- Tax ID must match exactly
- Vendor name standardization
- Payment terms mapping required
- Blocked vendors don't sync claims
- Address format conversion
Financial Rules
- Journal entries must balance
- GL accounts must exist in BC
- Posting dates must be open period
- Dimensions required for posting
- Tax codes must be valid
Performance Rules
- Batch size limits enforced
- Rate limiting on API calls
- Sync timeout after 5 minutes
- Queue processing priority
- Off-hours for large syncs
Integrations
| System | Integration Type | Purpose |
|---|---|---|
| Business Central API | REST/OData | Data synchronization |
| BC Webhooks | HTTP POST | Real-time events |
| Azure Service Bus | Message Queue | Async processing |
| Azure Functions | Serverless | Data transformation |
| Key Vault | Secret Store | Credential management |
| Application Insights | Monitoring | Performance tracking |
Common Issues
| Issue | Description | Resolution |
|---|---|---|
| API Timeout | BC API not responding | Retry with backoff |
| Invalid GL Account | Account doesn't exist in BC | Map to valid account |
| Duplicate Vendor | Vendor exists in BC | Merge or link records |
| Period Closed | Cannot post to closed period | Post to next period |
| Authentication Failed | Token expired | Refresh token |
| Rate Limit | Too many API calls | Implement throttling |
Screenshots Needed
- Integration Dashboard
- Sync Configuration
- Field Mapping Interface
- Sync Queue Monitor
- Error Resolution Queue
- Sync History Log
- Conflict Resolution Tool
- Manual Sync Trigger
- Performance Metrics
- Webhook Configuration
Performance Considerations
- API call optimization
- Batch processing efficiency
- Queue management
- Caching strategies
- Connection pooling
- Async processing
- Error recovery performance
Security Considerations
- OAuth 2.0 authentication
- API key encryption
- Secure credential storage
- TLS for data transit
- Audit logging
- Role-based access
- Data masking in logs
Notes
- BC API version compatibility important
- Webhook reliability requires monitoring
- Consider BC customizations impact
- Plan for BC upgrade impacts
- Document field mapping changes