Hi
I have create a button and when user click on the button in sales order i want to update the reserve physical qty == deliver now qty
by default reserve physical qty == sales qty but i want to update the reserve physical qty == deliver now qty
does any on have x++ code on how to update the reserve physical qty base on sales order
Thank you
*This post is locked for comments
This code is meaningless without your data, we don't know if there is inventTrans, so it would go inside of the if statement or you have enough in stock to reserve. Did you try to debug ?
thanks ievgen Miroshnikov but the code does not work in AX 2012 R3
i am testing with below code but its not working;
static void Job16(Args _args)
{
InventTrans inventTrans;
InventTransOrigin inventTransOrigin;
InventMovement inventMovement;
InventUpd_Reservation inventUpd_Reservation ;
// Reserve an item
SalesLine SalesLine = SalesLine::findRecId(5640934326);
select inventTrans
where inventTrans.ItemId == SalesLine.ItemId
&& inventTrans.StatusReceipt == StatusReceipt::None
&& inventTrans.StatusIssue == StatusIssue::OnOrder
exists join inventTransOrigin
where inventTransOrigin.RecId == inventTrans.InventTransOrigin;
if(inventTrans.RecId)
{
Inventmovement = inventTrans.inventmovement(true);
inventUpd_Reservation = InventUpd_Reservation::newInventDim(inventmovement,SalesLine.inventDim(),-120, false);
inventUpd_Reservation.updatenow();
}
info(strFmt("%1",salesLine.reservedPhysicalSalesUnit()));
}
Hi rdewan,
Please check this blog post community.dynamics.com/.../reserving-inventory-by-code it has a code snippet how to reserve qty for sales order line, in this blog post Qty reserved is 5 but you can put deliver now qty instead.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156