Any tips on how to change a PurchaseOrder's status via the API?
Can't seem to find a specific method for it.
Do I just set PurchaseOrder.OrderStatus to a new one? Is the audit automatically updated to reflect this? And are any associated pipelines automatically executed, or do I need to this manually?
For the pipelines to run and the audit trail to be updated, you need to use the UCommerce.Transactions.OrderService class. Just pass your order, new status and optinally a username to the service, and it will take care the rest.
You can get an instance of the service though the ObjectFactory:
var service = ObjectFactory.Instance.Resolve<IOrderService>();
Change order status via API
Any tips on how to change a PurchaseOrder's status via the API?
Can't seem to find a specific method for it.
Do I just set PurchaseOrder.OrderStatus to a new one?
Is the audit automatically updated to reflect this?
And are any associated pipelines automatically executed, or do I need to this manually?
Best regards,
Soeren Sprogoe
Hi Søren,
For the pipelines to run and the audit trail to be updated, you need to use the UCommerce.Transactions.OrderService class. Just pass your order, new status and optinally a username to the service, and it will take care the rest.
You can get an instance of the service though the ObjectFactory:
- Lasse
is working on a reply...