Any way to update an already existing purchase?

Vote:
 

Hello there,

I'm on a situation where I need to update already existing purchases. There are new discounts and prices that should be applied to several previous purchases and, therefore, totals, gross totals, shipments, etc... should be recalculated. Is it any way to quickly update a purchase order besides having to recreate it again?

Thank you and kind regards,

David

#88092
Jul 01, 2014 16:09
Vote:
 

As additional information, I tried to do the following:

PurchaseOrder p = OrderContext.Current.GetPurchaseOrderById(1817);
                OrderGroupWorkflowManager.RunWorkflow(p, OrderGroupWorkflowManager.OrderRecalculateWorkflowName);

But when running the workflow, a NullreferenceException is raised (and I made sure through debugger that PurchaseOrder p is not null).

#88094
Jul 01, 2014 16:15
Vote:
 

Hi,

Did you try with

OrderGroupWorkflowManager.RunWorkflow(p, OrderGroupWorkflowManager.OrderRecalculateWorkflowName, false); ?

Regards.

/Q

#88105
Jul 02, 2014 4:32
Vote:
 

Thanks for answering, Quan Mai. Unafortunately, even though an exception is not raised, the purchase is not update with new discounts as I'd wish.

#88172
Jul 03, 2014 16:03
* 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.