web
You’re offline. This is a read only version of the page.
close
Skip to main content
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

(1) ShareShare
ReportReport
Posted on by
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
    237,168 Most Valuable Professional on at
    Cannot post packing slip for intercompany SO when load contains multiple WHSLoadLine records
    Moved from Integration, Dataverse, and general topics forum to Supply chain | Supply Chain Management, Commerce forum.

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

Responsible AI policies

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

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Siv Sagar Profile Picture

Siv Sagar 336 Super User 2025 Season 2

#2
Danny Bilodeau Profile Picture

Danny Bilodeau 216 Super User 2025 Season 2

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 199 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans