For Litium 7, we have custom code in the order state builder to add ERP order export to the init-to-confirmed order transition or the confirmed-to-processing order transition.
What’s the best-practice way to export orders to ERP in Litium 8 without Connect?
Is it to subscribe to the SalesOrderConfirmed event, e.g.
_eventBroker.Subscribe<SalesOrderConfirmed>(ExportOrderToErp);
?
Litium version: 8.5
Yes you can subscribe to confirmed event.
Don’t know what is best prectice, but I would be careful with the subscribe for export because you don’t have a retry.
If something fails on the Litium side, or the ERP side that order gets stuck.
I always do the export in a scheduled task with a short interval with the help of the dataservice.
_dataService.CreateQuery().Filter(f => f.Status(new { OrderState.Confirmed })).ToList()