Try our conversational search powered by Generative AI!

How to manually update an order status?

Vote:
 

Hi!

I can't find anywhere in Commerce Manager (v9) order handling where I can change the order status except for cancelling the order? How do I for example update the order to Completed?
If it is not possible to do it manually, can I by code set the order status to Completed?

Thanks!

/Kristoffer

#148659
May 19, 2016 14:39
Vote:
 

Hi,

It depends on how should your order be handled, but if it's a normally order (which requires shipment), you will need to:

- Release the shipment (equivalent to "the warehouse is ready")

- Switch to Shipping/Receiving/Shipments/Released For Shipping, and add the shipment to a pick list (the shipment is shipped)

- In Pick Lists, mark your shipment as complete (the shipment is delivered)

When all shipments in an order are complete, the order will be Completed.

Regards,

/Q

#148661
May 19, 2016 14:47
Vote:
 

Thanks, now I understand.

Can I programaticly update the order status to Completed? We are not handling the orders in Commerce, they are transferred to another system where they are handled.

/Kristoffer

#148662
May 19, 2016 14:50
Vote:
 

You should be able to use OrderStatusManager to set the status of Shipments and Orders.

Regards,

/Q

#148664
May 19, 2016 14:53
Vote:
 

Setting the status programatically can be done in more than one way. 

var order = OrderContext.Current.FindOrderByTrackingNumber("MyOrderNumber");

// Cancel order using OrderStatusManager. Will update the status and run the workflow 'RecalculatePurchaseOrderWorkflow'

OrderStatusManager.CancelOrder(order);

// Or by setting the status property (which is a string), no workflow will be automatically run.

order.Status = OrderStatus.Cancelled.ToString();

Note that not all statuses can be set using the OrderStatusManager, and using the OrderStatusManager will automatically run some additional logic like running different workflows, setting shipment statuses etc.

#148679
May 19, 2016 22:11
Vote:
 

Thanks Mattias, I will try it out!

/Kristoffer

#148681
May 19, 2016 23:44
Vote:
 

Hi,

Anaylyse your requirements before using the status manager as you may not require to run the work flows, Order Status Manager may not be best for you if your order fulfilment system is outside of EPiServer.

This might be enough for you.

purchaseOrder.Status = "Completed";
purchaseOrder.AcceptChanges();

Dont use this function of order status manager to update status

SaveOrderStatus Saves changes in OrderStatusDto. Not implemented!

Cancel order notes: http://world.episerver.com/blogs/K-Khan-/Dates/2016/2/cancel-order-notes/

Regards

/K

#148702
May 20, 2016 13:45
Vote:
 

Thanks K for good inout!

/Kristoffer

#148776
May 23, 2016 22:30
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.