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

Cannot post packing slip for intercompany SO when load contains multiple WHSLoadLine records in fo

(6) ShareShare
ReportReport
Posted on by 21
From the chooseLinesFromWHSLoadId method of the SalesFormletterParmDataPackingslip class
 
   while (searchStatement.nextRecord(searchObject))
   {
       this.processLoadLine(loadLine);
   }
   if (previousInventTransIdForProcessLoad)
   {
       this.createParmLineForWHSLoadLine();
   }
 
Since this.processLoadLine(loadLine); in the processLoadLine method returns empty, the packing slip is not being created.

                if (processedSalesLine && processedSalesLine.in(localSalesLine.RecId))
                {
                    previousInventTransIdForProcessLoad = '';
                    previousLoadLineShipmentId = '';
                    return;
                }

 
I am getting stuck at the check, and therefore I cannot create the packing slip.
 if (previousInventTransIdForProcessLoad)
 {
     this.createParmLineForWHSLoadLine();
 }
Is it correct to override this with an extension and force it to return empty?
 protected void processLoadLine(WHSLoadLine _loadLine)
 {
     SalesLine localSalesLine = _loadLine.salesLine();
     WHSLoadLine localLoadLine = _loadLine;

     if (!localSalesLine.Blocked)
     {
         if (this.checkInvetTransId(_loadLine, previousInventTransIdForProcessLoad)
             || this.checkShipmentIdChanged(_loadLine, previousLoadLineShipmentId))
         {
             this.createParmLineForWHSLoadLine();
         }

         if (WHSPackingSlipSalesParmLineLoadUnionV2Flight::instance().isEnabled() &&
             localSalesLine.salesTable().isInterCompanyOrder())
         {

             if (processedSalesLine && processedSalesLine.in(localSalesLine.RecId))
             {
                 previousInventTransIdForProcessLoad = '';
                 previousLoadLineShipmentId = '';
                 return;
             }

             if (WHSPackingSlipSalesParmLineUseLoadLineFromSearchFlight::instance().isEnabled())
             {
                 WHSLoadLine localLoadLineFromSearch;
                 SysDaSearchObject searchObject = new SysDaSearchObject(this.buildLoadUnionQuery(localSalesLine.SalesId, localSalesLine.InventTransId, localLoadLineFromSearch));
                 SysDaSearchStatement searchStatement = new SysDaSearchStatement();

                 searchStatement.findNext(searchObject);
                 int countOfRelatedLoadLines = localLoadLineFromSearch.RecId;

                 if (countOfRelatedLoadLines > 1)
                 {
                     if (!processedSalesLine)
                     {
                         processedSalesLine = new Set(Types::Int64);
                     }

                     processedSalesLine.add(localSalesLine.RecId);
                     localLoadLine = localLoadLineFromSearch;
                 }
             }
             else
             {
                 SysDaSearchObject searchObject = new SysDaSearchObject(this.buildLoadUnionQuery(localSalesLine.SalesId, localSalesLine.InventTransId, localLoadLine));
                 SysDaSearchStatement searchStatement = new SysDaSearchStatement();

                 searchStatement.findNext(searchObject);
                 int countOfRelatedLoadLines = localLoadLine.RecId;

                 if (countOfRelatedLoadLines > 1)
                 {
                     if (!processedSalesLine)
                     {
                         processedSalesLine = new Set(Types::Int64);
                     }

                     processedSalesLine.add(localSalesLine.RecId);
                 }
                 else
                 {
                     localLoadLine = _loadLine;
                 }
             }
         }

         if (!PdsGlobal::pdsIsCWItem(localLoadLine.ItemId))
         {
             inventQtyLineForProcessLoad   += localLoadLine.InventQty;
         }
         else
         {
             inventQtyLineForProcessLoad  += localLoadLine.PickedWeight;
             cwQtyLineForProcessLoad      += localLoadLine.InventQty;
         }

         updateTableRefId = previousSalesLineForProcessLoad.SalesId != localSalesLine.SalesId;

         previousInventTransIdForProcessLoad  = localLoadLine.InventTransId;
         previousSalesLineForProcessLoad      = localSalesLine;

         if (this.parmCurrentLoadTable().PackingSlipCreationPolicy == WHSLoadPackingSlipCreationPolicy::Shipment)
         {
             previousLoadLineShipmentId  = localLoadLine.ShipmentId;
         }
     }
     previousLoadLineForProcessLoad.data(localLoadLine);
 }
 
 (When an order line has multiple WHSLoadLine entries and the serial numbers are not populated, the process hits this validation and the packing slip cannot be posted.)
I have the same question (0)
  • Martin Dráb Profile Picture
    239,029 Most Valuable Professional on at
    Moved from Integration, Dataverse, and general topics forum to Supply chain | Supply Chain Management, Commerce forum.
  • AT-18080754-0 Profile Picture
    21 on at
    Thank you for moving the thread!
  • Mallesh Deshapaga Profile Picture
    1,711 on at
    What issue are you encountering when trying to post the packing slip? If there is only one line, does it work without any issue. Does the problem occur only when there are multiple lines? Please provide screenshots
  • AT-18080754-0 Profile Picture
    21 on at
    Yes, it works correctly when there is only one load line for a sales order line. However, if a single sales order line has multiple WHS load lines, the packing slip is posted with empty lines.

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!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Mallesh Deshapaga Profile Picture

Mallesh Deshapaga 254

#2
Laurens vd Tang Profile Picture

Laurens vd Tang 188 Super User 2026 Season 1

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 131 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans