Hello there,
I've got the following code below to add a hold onto a sales order.
ttsBegin;
MCRHoldCodeTrans holdCodeTrans;
holdCodeTrans.InventRefId = _salesId;
holdCodeTrans.MCRHoldCode = 'Pricing';
holdCodeTrans.insert();
ttsCommit;
I've added this code to an extension class in WhsWarehouseRelease. Something must be off as I'm not seeing the hold applied. What I've tried is running the code in a Runnable class and it appears to work there. I may be missing something?
Thank you!
ttsabort will roll back anything that was done inside that transaction. You can't do anything about that.
Hello,
I discovered a method in the stack call with was calling ttsabort under a specific condition. When I created the hold record I'm in that condition. Is there a way to force the insert regardless of the ttsabort call? Thank you.
I used CoC, and yes, I did run the debugger. The method is being called, I even see the RecId when the object is built but I can't find the record in the MCRHoldCodeTrans table nor can I see it on the Sales order's "Order hold". I just tried a full model compile and still no luck.
Did you implement this using event handler or using COC ? Did you check in the debugger , if that method is being called when you execute your process ?
André Arnaud de Cal...
291,979
Super User 2025 Season 1
Martin Dráb
230,848
Most Valuable Professional
nmaenpaa
101,156