Table of Contents

KVSKBAReleasePurchaseDocument

Summary: Handles Business Central events for Release Purchase Document, including On Manual Release Or Send For Approval, Send Purchase Document For Approval, and Check Blanket Purchase Order Fields.

Events

OnAfterManualReleaseOrSendForApproval(Record Purchase Header) :

Summary: Integration event raised after manual release or sending for approval processing completes.

[IntegrationEvent(false, false)]
local procedure OnAfterManualReleaseOrSendForApproval(var PurchaseHeader: Record "Purchase Header"): 

Parameters:

  • PurchaseHeader: The purchase header record that was processed.

Remarks: Allows subscribers to: - Perform additional validations after standard checks - Update custom fields or related records - Execute custom business logic before actual release - Log or audit release/approval actions

         Called after:
         - Position numbers are calculated
         - Direct unit costs are updated
         - Invoice discounts are recalculated
         - Mandatory fields are validated
        
         Only triggered for documents with Status = Open or Pending Prepayment.

OnBeforeOnManualReleaseOrSendForApproval(Record Purchase Header, Boolean, Boolean) :

Summary: Integration event raised before manual release or sending for approval processing starts.

[IntegrationEvent(false, false)]
local procedure OnBeforeOnManualReleaseOrSendForApproval(var PurchHeader: Record "Purchase Header"; CalledOnSendingForApprovalPar: Boolean; var IsHandled: Boolean): 

Parameters:

  • PurchHeader: The purchase header record to be processed.
  • CalledOnSendingForApprovalPar: TRUE if called during approval request, FALSE if called during manual release.
  • IsHandled: Set to TRUE to skip standard processing.

Remarks: Allows subscribers to: - Override standard release/approval logic by setting IsHandled to TRUE - Perform custom pre-validations - Implement alternative processing logic - Add custom checks before price calculations

         If IsHandled is set to TRUE, all standard processing is skipped:
         - Position number calculation
         - Direct unit cost updates
         - Invoice discount recalculation
         - Mandatory field validation
        
         Called at the very beginning of OnManualReleaseOrSendForApproval.