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.)