Skip to content

KVSKBASalesChangePrintLine#

Procedures#

ChangePrintLineForInv(Record Sales Invoice Line) :#

Summary: Changes the print line flag for selected posted sales invoice lines.

procedure ChangePrintLineForInv(var SalesInvoiceLine: Record "Sales Invoice Line"): 

Parameters:

  • SalesInvoiceLine: Record set of Sales Invoice Lines to modify

Remarks: This procedure displays a menu allowing the user to either set or clear the KVSKBAPrintLine flag on multiple selected invoice lines. Setting the flag marks lines for printing on reports, while clearing it hides lines from printed output (only allowed when line amount is zero, validated by CheckIfSalesLineCanBeHidden). This is useful for controlling which lines appear on printed invoices, such as hiding zero-amount lines or marking specific lines for special treatment in report layouts.

ChangePrintLineForShpts(Record Sales Shipment Line) :#

Summary: Changes the print line flag for selected posted sales shipment lines.

procedure ChangePrintLineForShpts(var SalesShipmentLine: Record "Sales Shipment Line"): 

Parameters:

  • SalesShipmentLine: Record set of Sales Shipment Lines to modify

Remarks: This procedure displays a menu allowing the user to either set or clear the KVSKBAPrintLine flag on multiple selected shipment lines. Setting the flag marks lines for printing on shipment reports, while clearing it hides lines from printed output (only allowed when quantity is zero, validated by CheckIfSalesLineCanBeHidden). This provides control over which shipment lines appear on printed documents, useful for hiding zero-quantity lines or managing report layouts for delivery notes and packing lists.

ChangePrintLineForCrMemo(Record Sales Cr.Memo Line) :#

Summary: Changes the print line flag for selected posted sales credit memo lines.

procedure ChangePrintLineForCrMemo(var SalesCrMemoLine: Record "Sales Cr.Memo Line"): 

Parameters:

  • SalesCrMemoLine: Record set of Sales Cr.Memo Lines to modify

Remarks: This procedure displays a menu allowing the user to either set or clear the KVSKBAPrintLine flag on multiple selected credit memo lines. Setting the flag marks lines for printing on credit memo reports, while clearing it hides lines from printed output (only allowed when line amount is zero, validated by CheckIfSalesLineCanBeHidden). This enables control over which credit memo lines appear on printed documents, particularly useful for managing zero-amount lines or customizing credit memo report layouts.

Events#

OnBeforeCheckIfSalesLineCanBeHidden(RecordId, Decimal, Boolean, Boolean) :#

Summary: Integration event raised before checking if a sales document line can be hidden from print output.

[IntegrationEvent(false, false)]
local procedure OnBeforeCheckIfSalesLineCanBeHidden(SalesDocumentLineRecordID: RecordId; CompareAmountQty: Decimal; var IsHiddenAllowed: Boolean; var IsHandled: Boolean): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBASalesChangePrintLine", 'OnBeforeCheckIfSalesLineCanBeHidden', '', false, false)]
local procedure DoSomethingOnBeforeCheckIfSalesLineCanBeHidden(SalesDocumentLineRecordID: RecordId; CompareAmountQty: Decimal; var IsHiddenAllowed: Boolean; var IsHandled: Boolean)
begin
end;

Parameters:

  • SalesDocumentLineRecordID: RecordId of the sales document line being checked
  • CompareAmountQty: The amount or quantity value to compare (Line Amount for invoices/credit memos, Quantity for shipments/returns)
  • IsHiddenAllowed: Output parameter indicating whether hiding the line is allowed
  • IsHandled: Flag to indicate if the check is handled by the subscriber

Remarks: This integration event allows subscribers to implement custom logic for determining whether a sales document line can be hidden from printed reports by clearing the KVSKBAPrintLine flag. The standard logic only allows hiding lines with zero amount/quantity, but subscribers can override this by setting IsHiddenAllowed and IsHandled. This is useful for implementing custom business rules for print line visibility, such as allowing specific line types to be hidden regardless of amount, or enforcing stricter visibility rules based on document type, customer, or other criteria.