# Change order status in module panel

**URL:** <https://forum.litium.com/t/change-order-status-in-module-panel/1487>\
**Category:** Questions\
**Created:** [May 14, 2020, 6:51pm UTC](https://forum.litium.com/t/change-order-status-in-module-panel/1487 "2020-05-14T18:51:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonas.olsson](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/jonas.olsson/32/177_2.png) [@jonas.olsson](https://forum.litium.com/u/jonas.olsson)\
**Post date:** [May 14, 2020, 6:51pm UTC](https://forum.litium.com/t/change-order-status-in-module-panel/1487/1 "2020-05-14T18:51:03Z")

</div>

**Background**

In our solution an order ends up in _Attention_ state when shipment couldn’t be created in Unifaun because of invalid address. We are now creating an order panel for correcting delivery address and then send it to Unifaun again. Sending to Unifaun is currently triggered when an order enters _Confirmed_ state, this means I want to change order state to _Confirmed_ after correcting address, then it will be sent to Unifaun again.

**The problem**

I can’t change order status in `SavePanel` method. If I’m using

`order.SetOrderStatus((short)OrderState.Confirmed, ModuleECommerce.Instance.AdminToken);`

then the order confirmed entry action is triggered but I will get an error

_Order (cb8fc1e4-6a1d-4a57-9f66-8a12374979be) has already been changed in the database. Get a new copy of the object and submit your changes again._

and if I’m using

`orderCarrier.OrderStatus = (short)OrderState.Confirmed;`

then the order confirmed entry action is not triggered.

(I also tried changing delivery to a new delivery state _Retry_ with a related order state _Confirmed_ in `StateTransitionBuilder` but that will give me the same error as above.)

How can I move order to _Confirmed_ state?

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/litium/original/1X/9b2b765ca2a8ad848e7c9b2506e871dc63692e33.png)

Litium version: 7.3.1-patch-1911150957

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/litium/original/1X/12eddac3b8b661de1db86af10ac8151b571e6fb9.png) [@system](https://forum.litium.com/u/system)\
**Post date:** [June 11, 2020, 6:51pm UTC](https://forum.litium.com/t/change-order-status-in-module-panel/1487/2 "2020-06-11T18:51:06Z")

</div>

Closed on June 11, 2020, 6:51pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
