When integrating external systems with D365 FO to create sales orders (header and lines) the approach depends on the requirements for transactional integrity, performance and complexity. If your integration is real-time and critical, implement a custom service/use Data management framework in batch mode that wraps the standard Sales order creation logic.
OData is fine for simpler scenarios but when the scenarios are cumbersome and complex won't recommend OData.
Suggestions:
1. OData with Standard Entities
Adv:
- Works well for real-time integrations where the number of Sales order lines are around 1500-2000 lines.
DisAdv:
- Requires multiple calls, one for header and one for lines (needs Sales Order Number)
- No native transactions across header and lines
For real-time integration if multiple calls can be handled and the transaction volume is lower.
2. Data Management Framework:
Adv:
- Bulk or Batch order processing
- Handles large volumes efficiently
Can be used if your integration is asynchronous and can run in scheduled batches.
3. Custom Service/Custom API:
Adv:
- Recommended for large, complex approach that accepts a single payload with multiple transactional lines and ensures atomicity - where the entire order is either created or nothing is.
- Easier to consider additional validations and business logic.
Uses the SysOperation Framework that is flexible and easier to integrate with external systems. Ensures data consistency and transactional integrity. Also, easier to handle custom fields and custom business logic that addresses the requirement in hand, in one place.
Hope this helps. Happy to answer questions, if any.