If there is no onhand with that dimension and there ordered quantity, then it will put the status of inventory transaction to ReserveOrdered.
info(strFmt("%1",salesLine.reservedPhysicalSalesUnit())); → this will return zero, as there is no physical reserved quantity and you only have ordered reserved.
thank you now my code is working good . below is the code if any one need it
/*
this methos is used for update the reserve Physical qty
take 3 paramater
RecId = this is sales line recid
reservePhysical = this is the qty we get from deliver now
reservedPhysical = this is the qty we get from previously reserved qty
*/
/*
here we check the condetion
and set the qty to add or deduct for physical reserver qty
*/
if (reservePhysical < reservedPhysical)
{
qty = reservedPhysical - reservePhysical;
}
else if(reservePhysical > reservedPhysical)
{
qty = reservedPhysical - reservePhysical;
}
// find the record on sales line base on recid
salesLine = SalesLine::findRecId(_recId);
select inventTransOrigin
where inventTransOrigin.InventTransId == salesLine.InventTransId
join inventTrans
where inventTrans.InventTransOrigin == inventTransOrigin.RecId
&& inventTrans.StatusReceipt == StatusReceipt::None;
//if inventTrans.RecId is not 0 then we continue
if(inventTrans.RecId)
{
inventMovement = inventTrans.inventmovement(true);
// here we set the paramater for InventUpd_Reservation check class InventUpd_Reservation for more info
reservation = InventUpd_Reservation::newInventDim(inventmovement,inventTrans.inventDim(),qty, false);
reservation.updatenow();
I have a task in d365 . can anyone please share the code in x++ for the same??
I am a beginner and have 0 idea. Please help.
Task: Sales order line reservation
Create a new column in sales order line – “Reserved quantity” and “Backorder quantity” (Non-editable field)
Create a button on sales order line action pane – “Reserve quantity”.
After saving the quantity on sales line, and pressing your button, system should reserve quantity of selected lines, multi select of line should be allowed:
For example,
Item A – 10 quantities (Sales line) [But only 4 is available physical].Then,
Reserve quantity should show 4 quantity and backorder quantity should show (Quantity – Reserved quantity) = 10 – 4 = 6.