Skip to content

KVSPSAUpdateAbsencesToResPlan#

Events#

KVSPSAOnAfterCalculateDaysWithCapacity(Record Employee Absence, Integer) :#

Summary: Event fired after calculating days with capacity during employee absence processing. Allows extensions to modify the calculated number of days with capacity. This event enables custom calculation of working days available for resource planning based on employee absence patterns and capacity requirements.

[IntegrationEvent(false, false)]
local procedure KVSPSAOnAfterCalculateDaysWithCapacity(EmployeeAbsence: Record "Employee Absence"; var DaysWithCapacity: Integer): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSAUpdateAbsencesToResPlan", 'KVSPSAOnAfterCalculateDaysWithCapacity', '', false, false)]
local procedure DoSomethingKVSPSAOnAfterCalculateDaysWithCapacity(EmployeeAbsence: Record "Employee Absence"; var DaysWithCapacity: Integer)
begin
end;

Parameters:

  • EmployeeAbsence: The employee absence record being processed for capacity calculation.
  • DaysWithCapacity: The calculated number of days with capacity (passed by reference for modification).

KVSPSAOnAfterValidateResourceJobPlanningFields(Record KVSPSAResource-Job Planning, Record Job, Record Cause of Absence, Record Employee Absence) :#

Summary: Event fired after validating resource job planning fields during absence processing. Allows extensions to modify or add additional validation for resource planning fields. This event enables custom validation logic for resource job planning records when they are created or updated based on employee absence data.

[IntegrationEvent(false, false)]
local procedure KVSPSAOnAfterValidateResourceJobPlanningFields(var ResourceJobPlanning: Record "KVSPSAResource-Job Planning"; Job: Record "Job"; CauseofAbsence: Record "Cause of Absence"; EmployeeAbsence: Record "Employee Absence"): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSAUpdateAbsencesToResPlan", 'KVSPSAOnAfterValidateResourceJobPlanningFields', '', false, false)]
local procedure DoSomethingKVSPSAOnAfterValidateResourceJobPlanningFields(var ResourceJobPlanning: Record "KVSPSAResource-Job Planning"; Job: Record "Job"; CauseofAbsence: Record "Cause of Absence"; EmployeeAbsence: Record "Employee Absence")
begin
end;

Parameters:

  • ResourceJobPlanning: The resource job planning record being validated (passed by reference for modification).
  • Job: The job record associated with the resource planning.
  • CauseofAbsence: The cause of absence record defining the absence type and characteristics.
  • EmployeeAbsence: The employee absence record that initiated the resource planning update.

KVSPSAOnBeforeCheckDistribution(Record Employee Absence, Decimal, Date, Boolean) :#

Summary: Event fired before checking distribution of employee absence to resource planning. Allows extensions to override or customize the distribution validation logic. This event enables custom validation of absence distribution parameters, including quantity distribution and date ranges for resource planning updates.

[IntegrationEvent(false, false)]
local procedure KVSPSAOnBeforeCheckDistribution(EmployeeAbsence: Record "Employee Absence"; DistributedQuantity: Decimal; ToDate: Date; var IsHandled: Boolean): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSAUpdateAbsencesToResPlan", 'KVSPSAOnBeforeCheckDistribution', '', false, false)]
local procedure DoSomethingKVSPSAOnBeforeCheckDistribution(EmployeeAbsence: Record "Employee Absence"; DistributedQuantity: Decimal; ToDate: Date; var IsHandled: Boolean)
begin
end;

Parameters:

  • EmployeeAbsence: The employee absence record being checked for distribution.
  • DistributedQuantity: The quantity that has been distributed for the absence period.
  • ToDate: The end date for the distribution period being validated.
  • IsHandled: Boolean flag (passed by reference) indicating whether the event subscriber has handled the distribution check and standard logic should be bypassed.

KVSPSAOnBeforeCreateOrUpdateResourcePlanning(Record Employee Absence, Date, Boolean, Decimal) :#

Summary: Event fired before creating or updating resource planning for a specific day. Allows extensions to control whether planning should be created and customize the quantity distribution. This event enables day-by-day control over resource planning creation, including the ability to skip specific dates or modify quantity distribution based on custom business logic.

[IntegrationEvent(false, false)]
local procedure KVSPSAOnBeforeCreateOrUpdateResourcePlanning(EmployeeAbsence: Record "Employee Absence"; StartDate: Date; var CreatePlanningForDay: Boolean; var QuantityToDistribute: Decimal): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSAUpdateAbsencesToResPlan", 'KVSPSAOnBeforeCreateOrUpdateResourcePlanning', '', false, false)]
local procedure DoSomethingKVSPSAOnBeforeCreateOrUpdateResourcePlanning(EmployeeAbsence: Record "Employee Absence"; StartDate: Date; var CreatePlanningForDay: Boolean; var QuantityToDistribute: Decimal)
begin
end;

Parameters:

  • EmployeeAbsence: The employee absence record being processed for resource planning.
  • StartDate: The specific date for which resource planning is being considered.
  • CreatePlanningForDay: Boolean flag (passed by reference) indicating whether resource planning should be created for this specific date.
  • QuantityToDistribute: The quantity to be distributed for this date (passed by reference for modification).

KVSPSAOnBeforeShowMessageNoCapacity(Record Employee Absence, Date, Boolean) :#

Summary: Event fired before showing a message about no capacity being available. Allows extensions to override or customize the no capacity message handling. This event enables custom handling of no capacity scenarios, including the ability to suppress messages, show custom messages, or implement alternative logic when capacity is not available.

[IntegrationEvent(false, false)]
local procedure KVSPSAOnBeforeShowMessageNoCapacity(EmployeeAbsence: Record "Employee Absence"; ToDate: Date; var IsHandled: Boolean): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSAUpdateAbsencesToResPlan", 'KVSPSAOnBeforeShowMessageNoCapacity', '', false, false)]
local procedure DoSomethingKVSPSAOnBeforeShowMessageNoCapacity(EmployeeAbsence: Record "Employee Absence"; ToDate: Date; var IsHandled: Boolean)
begin
end;

Parameters:

  • EmployeeAbsence: The employee absence record for which no capacity was found.
  • ToDate: The end date of the period for which no capacity is available.
  • IsHandled: Boolean flag (passed by reference) indicating whether the event subscriber has handled the no capacity message and standard message display should be bypassed.

KVSPSAOnGetReferenceDate(Date, Boolean) :#

Summary: Use KVSPSAOnGetReferenceDate to change the reference date.

[IntegrationEvent(false, false)]
local procedure KVSPSAOnGetReferenceDate(var ReferenceDate: Date; var IsHandled: Boolean): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSAUpdateAbsencesToResPlan", 'KVSPSAOnGetReferenceDate', '', false, false)]
local procedure DoSomethingKVSPSAOnGetReferenceDate(var ReferenceDate: Date; var IsHandled: Boolean)
begin
end;

Parameters:

  • ReferenceDate: Date from which the employee absences will be transferred to the resource planning
  • IsHandled: Boolean