web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Picking list registration with partial picking

(0) ShareShare
ReportReport
Posted on by 10
Dear fellow members,
I have written a method, code below. I need to register a picking list in code
with a quantity that is less than the picking list quantity.
The problem is that this code only registers the full quantity,can someone
please tell me what I am doing wrong or provide alternative code?


str 50 RegisterPickingListValidationV2(str 20 SalesID,str 20 ItemID, str 20 RouteID, real qty, str 20 ORDERID) { // boolean retval = true; List list = new List(Types::String); WMSOrderTrans WOTTable; WMSOrder WOTable; WMSPickingRoute localWMSPickingRoute; RouteTable RT; SalesLine SL; InventTrans IT; SalesParmLine SPL; //str 20 RouteID; // str 20 ItemID; real Quantity; str s1; str sqty; str rqty; real resQuantity; str returnmsg; SalesFormLetter letter; SalesTable sale; SalesParmLine parmLine; ; try { letter=SalesFormLetter::construct(DocumentStatus::Invoice); sale = SalesTable::find(SalesID); ttsBegin; letter.update(sale, systemDateGet(), SalesUpdate::PickingList, AccountOrder::None, true, true); ttsCommit; ttsBegin; letter.salesTable(sale); letter.transDate (systemDateGet()); letter.specQty (SalesUpdate::PickingList); letter.proforma (true); letter.printFormLetter (true); letter.createParmUpdate(); letter.initParameters(letter.salesParmUpdate(), PrintOut::Current); // Printout info(letter.parmId()); letter.giroType(sale.giroType); letter.initLinesQuery(); while select forUpdate parmLine where parmLine.ParmId == letter.parmId() { // changed the Qty parmLine.DeliverNow = qty; // the following is stollen from the SalesEditLines form (field modified method) parmLine.setQty(parmLine.salesParmTable().ordering, letter.SalesParmUpdate().creditRemaining); parmLine.setInventDeliverNow(); parmLine.setLineAmount(); if (parmLine.closed) { parmLine.remainAfter = 0; parmLine.setRemainAfterInvent(); } parmLine.calcPackingUnitQty(); parmLine.update(); } letter.run(); ttsCommit; ///------------- while select forupdate SL where SL.ItemId == ItemID && SL.SalesId == SalesID { ttsbegin; SL.SalesDeliverNow = qty; ttscommit; returnmsg = "Deliver Now update to " + num2Str(Qty,0,4,1,3); } while select forupdate WOTTable where WOTTable.itemId == ItemID && WOTTable.routeId == RouteID// 'IRT473999' { if (WOTTable) { ttsbegin; WOTTable.qty = qty; ttscommit; returnmsg += " and WOTTABLE.qty = " + num2Str(Qty,0,4,1,3); // returnmsg += " and WOTTABLE.qtyNoShipment = " + num2Str( WOTable.qtyNoShipment,0,4,1,3); } else { return "item does not exist"; } // update the localWMStable while select forupdate WOTable where WOTable.itemId == ItemID && WOTable.inventTransId == WOTTable.inventTransId && WOTable.orderId == ORDERID// 'IRT473999' { if (WOTable) { ttsbegin; if (WOTable.qty < qty) { sqty = num2Str(Qty,0,4,1,3); rqty = num2Str(WOTable.qty,0,4,1,3); // WOTable.qtyRegistered(qty, ); return "Quantity out of range you requested " + sqty + " but only " + rqty + " exists"; } else { //WOTable.qtyRequested = qty; WOTable.qtyNoShipment = WOTable.qtyRequested - qty; returnmsg+= "and WOTable.qtyRequested = " +num2Str(WOTable.qtyRequested,0,4,1,3); returnmsg+= " and WOTable.qtyNoShipment = " +num2Str(WOTable.qtyNoShipment,0,4,1,3); } ttscommit; } else { return "item does not exist"; } } list.addEnd(RouteID); // WMSPickingRoute::finishMulti(list.pack());//Note - this is not in a single tts, so some routes migh //wmsDeliverPickedItems::checkDeliverPickedItems(localWMSPickingRoute.PickingRouteID,List.pack()) select firstonly localWMSPickingRoute where localWMSPickingRoute.pickingRouteID == ROUTEID; // WMSOrderTransType::finishPickingLinesMulti(list.pack()); WMSOrderTransType::finishPickingLinesMulti(list.pack(),localWMSPickingRoute.CurrentPickPalletId,localWMSPickingRoute.Operator); wmsDeliverPickedItems::checkDeliverPickedItems(ROUTEID,List.pack()); } s1 = num2Str(Qty,0,4,1,3); return "Registration successfulQTY is " + s1 + " " + returnmsg; } catch (Exception::Error) { return"Error occured trying to register"; } }

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    Did it work for you, though?

  • Abhijeet Kr  Profile Picture
    60 on at

    Hi , Even i am facing the same issue. It good with posting of all the lines within the pick list registration but to do registration for particular line along with our required quantity is an challenge. If you have workaround , if possible please share, it would be of great help.

  • Mahesh Holla Profile Picture
    30 on at

    Did you find the solution? 

    I have a similar requirement where the qty is less than picked qty.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#2
TAHER Mehdi Profile Picture

TAHER Mehdi 3

#3
Nakul Profile Picture

Nakul 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans