Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Cancel Order Not Updating Inventory

Vote:
 

After cancelling the order from Commerce Manager, the inventory of the relevant product is not updating (not incrementing). 

Is there any reason for this issue ?

When I dig further by implementing AdjustInventoryOrRemoveLineItem method, I found that OperationKeys are not available in shipment parameter passing to AdjustInventoryOrRemoveLineItem method.

is there any reason for NOT having OperationKeys ?

#206919
Edited, Sep 04, 2019 9:48
Vote:
 

Assuming you are using the default workflow, the inventory will not be reverted if the shipment has been shipped. Is that the case? 

#206924
Sep 04, 2019 10:29
Muvindu Amarasinghe - Sep 04, 2019 10:34
yes. I'm using Default workflow. the inventory is not be reverted when the order is cancelled from commerce manager.
can we cancel the order if the shipment has been already shipped ?
Please note that I cancel the order while the order is at the status "in progress".
Vote:
 

I see you updated your post (the screenshot is not available, though). OperationsKeys should be there. if it isn't, something must have gone wrong and it is impossible to trace down why.

Does this happen to all of your orders, or just some ?

#206937
Edited, Sep 04, 2019 11:53
Muvindu Amarasinghe - Sep 04, 2019 12:03
Updated the screenshot. Yes, This happens to all the orders
Quan Mai - Sep 04, 2019 12:15
How were the orders created and processed?
Muvindu Amarasinghe - Sep 04, 2019 12:20
Order created and processed without any errors.. And the inventory updated when creating the order. The issue is inventory does not revert when cancelling the order.
In which step, OperationsKeys are adding to shipment ?
Quan Mai - Sep 04, 2019 12:23
I was talking about the code. When you call the AdjustInventoryOrRemoveLineItem - either directly or indirectly when the order status is InProgress, the inventory will be reserved and operation keys added to IShipment.OperationKeys. It sounds like the order was not saved after that step?
Vote:
 

Hey sir Quan :)

We are working on the solution with a customer that has two requirements:

  • First requirement is -> The user created the order and the order is in "In Progress" status and we call "AdjustInventoryOrRemoveLineItem" after order created and status is "In Progress". The inventory is being decreased and works perfectly. Now admin comes to "Commerce Manager" and click on "Cancel Order". We are expecting the order being canceled (which it does) and the inventory increased. But it is not!
  • Second requirement is -> User does the order and order status is "Completed" and we call "AdjustInventoryOrRemoveLineItem". The number of inventory decreased. Now in "Commerce Manager" admin create "Return" and line items. We are expecting the number of inventory to increased.

Really appreciate your help Quan :) 

Aria

#206956
Sep 04, 2019 15:10
Vote:
 

The code looks like:

The order status could be "In Progress" or "Completed" (consider my comment on last thread). The 'RequestInventiry' calls "AdjustInventoryOrRemoveLineItems" internally!

#206960
Sep 04, 2019 15:26
Vote:
 

@Aria: It looks like you are missing a Save after RequestInventory 

#206961
Sep 04, 2019 15:38
Muvindu Amarasinghe - Sep 05, 2019 6:44
you are correct Sir Quan :)
Saved after RequestInventory and it worked... Thanks you so much for the great help.
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.