KVSFCYJobLinkUsage#
Procedures#
ApplyUsage(Record Job Ledger Entry, Record Job Journal Line) :#
Summary: Links job usage transactions to job planning lines based on whether a specific planning line is referenced. When a job planning line number is specified in the journal line, performs direct matching to that specific planning line with validation of usage link settings and quantity updates. When no planning line is specified, attempts to find matching planning lines based on job, task, type, and resource criteria, or creates new planning lines as needed. Handles unit of measure conversions, cost and amount calculations, and maintains usage link relationships. Essential for connecting actual job usage with planned activities in project management workflows.
procedure ApplyUsage(JobLedgerEntry: Record "Job Ledger Entry"; JobJournalLine: Record "Job Journal Line"):
Parameters:
JobLedgerEntry: Posted job ledger entry containing the actual usage data to be linked to planning lines.JobJournalLine: Job journal line providing planning line reference and line type information for the linking process.
Events#
OnBeforeMatchUsageSpecified(Record Job Planning Line, Record Job Journal Line, Record Job Ledger Entry, Boolean) :#
Summary: Integration event that is raised before matching job usage to a specifically referenced job planning line, providing an extension point for implementing custom usage linking logic, additional validation rules, or alternative matching workflows when a job planning line number is explicitly specified in the job journal line.
[IntegrationEvent(false, false)]
local procedure OnBeforeMatchUsageSpecified(var JobPlanningLine: Record "Job Planning Line"; var JobJournalLine: Record "Job Journal Line"; var JobLedgerEntry: Record "Job Ledger Entry"; var IsHandled: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSFCYJobLinkUsage", 'OnBeforeMatchUsageSpecified', '', false, false)]
local procedure DoSomethingOnBeforeMatchUsageSpecified(var JobPlanningLine: Record "Job Planning Line"; var JobJournalLine: Record "Job Journal Line"; var JobLedgerEntry: Record "Job Ledger Entry"; var IsHandled: Boolean)
begin
end;
Parameters:
JobPlanningLine: Job Planning Line record (passed by reference) that will be retrieved and matched with the job usage, allowing extensions to pre-populate or modify the planning line before standard matching processing occurs.JobJournalLine: Job Journal Line record (passed by reference) containing the planning line reference and line type information used for the specific usage matching process, providing context for custom matching logic.JobLedgerEntry: Job Ledger Entry record (passed by reference) containing the posted usage data that will be linked to the specified planning line, providing transaction details for custom validation and processing logic.IsHandled: Boolean variable (passed by reference) that should be set to true by the extension if it has completely handled the usage matching operation, preventing execution of standard specified usage matching logic.
OnBeforeModifyJobPlanningLine(Record Job Planning Line, Record Job Ledger Entry) :#
Summary: Integration event that is raised before modifying a job planning line during the usage linking process, providing an extension point for implementing custom field population, additional validation logic, or supplementary data assignment before the planning line modification is committed during the creation of new planning lines from job ledger entries.
[IntegrationEvent(false, false)]
local procedure OnBeforeModifyJobPlanningLine(var JobPlanningLine: Record "Job Planning Line"; JobLedgerEntry: Record "Job Ledger Entry"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSFCYJobLinkUsage", 'OnBeforeModifyJobPlanningLine', '', false, false)]
local procedure DoSomethingOnBeforeModifyJobPlanningLine(var JobPlanningLine: Record "Job Planning Line"; JobLedgerEntry: Record "Job Ledger Entry")
begin
end;
Parameters:
JobPlanningLine: Job Planning Line record (passed by reference) that has been created and populated with usage data and can be modified by extensions to add custom fields, perform additional calculations, or apply business-specific logic before final modification.JobLedgerEntry: Job Ledger Entry record containing the source usage data used for planning line creation, providing context and reference information for custom field population and validation logic during the modification process.
OnBeforeJobPlanningLineUse(Record Job Planning Line, Record Job Ledger Entry) :#
Summary: Integration event that is raised before calling the Use method on a job planning line during usage linking, providing an extension point for implementing custom usage application logic, additional validation rules, or supplementary processing before quantities, costs, and amounts are applied to the planning line from the job ledger entry.
[IntegrationEvent(false, false)]
local procedure OnBeforeJobPlanningLineUse(var JobPlanningLine: Record "Job Planning Line"; JobLedgerEntry: Record "Job Ledger Entry"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSFCYJobLinkUsage", 'OnBeforeJobPlanningLineUse', '', false, false)]
local procedure DoSomethingOnBeforeJobPlanningLineUse(var JobPlanningLine: Record "Job Planning Line"; JobLedgerEntry: Record "Job Ledger Entry")
begin
end;
Parameters:
JobPlanningLine: Job Planning Line record (passed by reference) that will have usage applied through the Use method, allowing extensions to modify the planning line or perform custom validation before usage application occurs.JobLedgerEntry: Job Ledger Entry record containing the usage data including quantities, costs, and amounts that will be applied to the planning line, providing context for custom usage application logic and validation rules.
OnMatchUsageUnspecifiedOnBeforeConfirm(Record Job Planning Line, Record Job Ledger Entry, Boolean) :#
Summary: Integration event that is raised before displaying the confirmation dialog when matching unspecified usage with empty line type, providing an extension point for implementing custom confirmation logic, automatic decision-making rules, or alternative user interaction workflows when usage linking encounters blank line types without matching planning lines.
[IntegrationEvent(false, false)]
local procedure OnMatchUsageUnspecifiedOnBeforeConfirm(JobPlanningLine: Record "Job Planning Line"; JobLedgerEntry: Record "Job Ledger Entry"; var Confirmed: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSFCYJobLinkUsage", 'OnMatchUsageUnspecifiedOnBeforeConfirm', '', false, false)]
local procedure DoSomethingOnMatchUsageUnspecifiedOnBeforeConfirm(JobPlanningLine: Record "Job Planning Line"; JobLedgerEntry: Record "Job Ledger Entry"; var Confirmed: Boolean)
begin
end;
Parameters:
JobPlanningLine: Job Planning Line record providing context for the confirmation scenario, containing information about the planning line that could not be matched with the job ledger entry during unspecified usage processing.JobLedgerEntry: Job Ledger Entry record containing the usage data that could not be automatically matched to a planning line, providing transaction details for custom confirmation logic and decision-making processes.Confirmed: Boolean variable (passed by reference) that can be set by the extension to provide an automatic confirmation decision, bypassing the standard user confirmation dialog when custom business logic can determine the appropriate action.
OnAfterMatchUsageSpecified(Record Job Planning Line, Record Job Journal Line, Record Job Ledger Entry) :#
Summary: Integration event that is raised after successfully matching job usage to a specifically referenced job planning line, providing an extension point for implementing additional processing logic, supplementary data updates, or post-matching validation workflows following the completion of specified usage linking operations.
[IntegrationEvent(false, false)]
local procedure OnAfterMatchUsageSpecified(var JobPlanningLine: Record "Job Planning Line"; var JobJournalLine: Record "Job Journal Line"; var JobLedgerEntry: Record "Job Ledger Entry"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSFCYJobLinkUsage", 'OnAfterMatchUsageSpecified', '', false, false)]
local procedure DoSomethingOnAfterMatchUsageSpecified(var JobPlanningLine: Record "Job Planning Line"; var JobJournalLine: Record "Job Journal Line"; var JobLedgerEntry: Record "Job Ledger Entry")
begin
end;
Parameters:
JobPlanningLine: Job Planning Line record (passed by reference) that has been matched and updated with the job usage data, allowing extensions to perform additional field updates or post-processing operations after the usage linking is completed.JobJournalLine: Job Journal Line record (passed by reference) that provided the planning line reference for the specific usage matching process, containing context information for post-matching processing and validation logic.JobLedgerEntry: Job Ledger Entry record (passed by reference) containing the usage data that has been successfully linked to the planning line, providing transaction details for additional processing and audit trail operations.