Generate Picking List and its registration in X++

In this article we will be focusing on generating a picking list and its registration for a salesline using X++ code.

Generate Picking List of Sales line in X++

Use this given method below to generate a picking list for a sales line(s) in X++

The two parameters passed to this method were the record of Sales Table and the container having list of InventTransId of sales lines which needs to be added to this picking list registration.

This method will return the Picking route ID of the registered picking list.

public WMSPickingRouteID generatePickingFromSalesLines(
SalesTable _salesTable,
container _salesLineReferences) { SalesFormLetter salesFormLetter; SalesParmLine salesParmLine; FormletterOutputContract outputContract; WMSPickingRoute wmsPickingRoute; salesFormLetter = SalesFormLetter::construct(DocumentStatus::PickingList); salesFormLetter.salesTable(_salesTable); salesFormLetter.initParmSalesTable(salesFormLetter.salesTable()); salesFormLetter.transDate(DateTimeUtil::getSystemDate(DateTimeUtil::getUserPreferredTimeZone())); salesFormLetter.specQty(SalesUpdate::All); salesFormLetter.proforma(salesFormLetter.salesParmUpdate().Proforma); salesFormLetter.printFormLetter(salesFormLetter.printFormLetter()); salesFormLetter.printCODLabel(NoYes::No); salesFormLetter.printShippingLabel(NoYes::No); salesFormLetter.usePrintManagement(false); salesFormLetter.creditRemaining(salesFormLetter.creditRemaining()); salesFormLetter.createParmUpdateFromParmUpdateRecord( SalesFormletterParmData::initSalesParmUpdateFormletter(
salesFormLetter.pack(), true, false, false)); salesFormLetter.initParameters(
Printout::Current); salesFormLetter.initLinesQuery(); // Delete unwanted records in SalesParmLine while select forupdate salesParmLine where salesParmLine.ParmId == salesFormLetter.parmId() { if (conFind(_salesLineReferences, salesParmLine.InventTransId) == 0) { salesParmLine.delete(); } }; outputContract = salesFormLetter.getOutputContract(); wmsPickingRoute = outputContract.parmJournal(); return wmsPickingRoute.pickingRouteID; }

Registration of picking list in X++

Use this given method below to do registration of a picking list by providing its picking route ID in X++

    public void pickingListRegisteration(WMSPickingRouteID _pickingRouteID)
        List list = new List(Types::String);



Thank you for reading this article hope you find it useful.

Omar Iqbal

Technical Consultant

  1. Wonderful blog! Do you have any recommendations for aspiring writers? I’m planning to start my own site soon but I’m a little lost on everything. Would you recommend starting with a free platform like WordPress or go for a paid option? There are so many options out there that I’m completely confused .. Any recommendations? Thanks a lot!

Comments are closed.

Previous Article

Reserve and Unreserve salesline inventory in X++

Next Article

Posting a Product Receipt with Item Registration through X++ code

Related Posts