Skip to content

KVSFCYDeliveryScheduleLib#

Procedures#

ChangeStatus(Record KVSFCYDeliverySchedHeader, Option) : Boolean#

Summary: Manages the status change workflow for delivery schedule documents with validation and user interaction. This procedure orchestrates the complete status change process by validating business rules, checking for duplicates, presenting a confirmation dialog to the user, and enforcing mandatory field requirements. It handles status transitions for both blanket delivery schedules and delivery schedules, ensuring proper validation of logistic and production codes for release status, checking mandatory fields, and preventing duplicate delivery schedules from being released simultaneously. The procedure returns true if the status change was successful and false if it was cancelled or failed validation.

procedure ChangeStatus(var deliveryScheduleHeaderVar: Record "KVSFCYDeliverySchedHeader"; var newStatusVar: Option): Boolean

Parameters:

  • deliveryScheduleHeaderVar: The delivery schedule header record for which the status should be changed, passed by reference to allow modifications.
  • newStatusVar: Returns the new status selected by the user through the status change dialog (New, Open, Released, or Finished).

Returns: True if the status change was completed successfully, false if it was cancelled by the user or failed validation checks.

RunChangeStatus(Record KVSFCYDeliverySchedHeader, Option) :#

Summary: Executes the actual status change operations for delivery schedule documents without user interaction. This procedure performs the technical implementation of status changes by coordinating warehouse management, order flow processing, and pricing calculations. It handles the complete workflow for releasing, reopening, and finishing delivery schedules by managing warehouse requests, order flow entries, price calculations, and archival processes. The procedure processes all delivery schedule line buffer entries and applies the appropriate operations based on the target status, including special handling for consignment processing and PUS (Planning Unit Status) validation for finished status.

procedure RunChangeStatus(var deliveryScheduleHeaderVar: Record "KVSFCYDeliverySchedHeader"; newStatusPar: Option): 

Parameters:

  • deliveryScheduleHeaderVar: The delivery schedule header record being processed, passed by reference to allow status updates and field modifications.
  • newStatusPar: The target status to which the delivery schedule should be changed (New, Open, Released, or Finished).

Events#

OnAfterRunChangeStatus(Record KVSFCYDeliverySchedHeader, Option) :#

Summary: Event triggered after running the status change operation for a delivery schedule document.

[IntegrationEvent(false, false)]
local procedure OnAfterRunChangeStatus(var deliveryScheduleHeaderVar: Record "KVSFCYDeliverySchedHeader"; var newStatusPar: Option): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSFCYDeliveryScheduleLib", 'OnAfterRunChangeStatus', '', false, false)]
local procedure DoSomethingOnAfterRunChangeStatus(var deliveryScheduleHeaderVar: Record "KVSFCYDeliverySchedHeader"; var newStatusPar: Option)
begin
end;

Parameters:

  • deliveryScheduleHeaderVar: The delivery schedule header record that has undergone the status change, passed by reference to allow further modifications.
  • newStatusPar: The new status that was applied to the delivery schedule (New, Open, Released, or Finished).