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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Unanswered

Registering SalesLine Inventory in D365 Finance and Operations

(1) ShareShare
ReportReport
Posted on by 18
Hello,
 
I want to register the saleslines inventory i dont have idea like how to do that with code,
I have tried with this code but the Document status of order is not getting Picking list.
Please help me that how can i register my saleslines so that the DocumentStatus of particular salesorder must be PickingList. (And yes all i am doing this is with SysOperation)
 
Thanks in Advance.
 
// Code 
 
  private WMSPickingRouteID generatePickingFromSalesLines(SalesTable _salesTable, container _salesLineReferences)
    {
        SalesFormLetter salesFormLetter;
        WMSPickingRouteID pickingRouteID;
        SalesParmLine salesParmLine;
        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.documentStatus(),
                salesFormLetter.pack(),
                true,
                false,
                false
            )
        );
        salesFormLetter.initParameters(salesFormLetter.salesParmUpdate(), 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();
            }
        }
        salesFormLetter.run();
        FormletterOutputContract outputContract = salesFormLetter.getOutputContract();
        WMSPickingRoute wmsPickingRoute = outputContract.parmJournal();
        return wmsPickingRoute.pickingRouteID;
    }
 
 
I have the same question (0)

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

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Mallesh Deshapaga Profile Picture

Mallesh Deshapaga 280

#2
Laurens vd Tang Profile Picture

Laurens vd Tang 187 Super User 2026 Season 1

#3
Venkat Profile Picture

Venkat 122

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans