Skip to content

KVSPSADistributionChangeMgt#

Procedures#

RecalcDistribution(Record KVSPSAJobPSPLine, Boolean, Integer) :#

Summary: Recalculate the distribution of a Job PSP Line. This procedure recalculates the distribution of a Job PSP Line based on the provided parameters. It checks if the distribution is active, if the line is not empty or temporary, and if the distribution level type is appropriate. If the conditions are met, it prompts the user for confirmation to carry out the recalculation. If the user confirms, it deletes old distribution entries, creates new distribution entries, and updates the Job PSP Line with the recalculated values. If the user chooses not to carry out the recalculation, it may update the distribution combined based on the selected option. If the Job PSP Line is empty or temporary, or if the distribution level type is not appropriate, the procedure exits without making any changes. If the distribution is not active, it exits without making any changes.

procedure RecalcDistribution(var JobPSPLine: Record "KVSPSAJobPSPLine"; IsQuantity: Boolean; BudgetLineNo: Integer): 

Parameters:

  • JobPSPLine: The Job PSP Line record to recalculate the distribution for.
  • IsQuantity: Indicates whether the recalculation is based on quantity.
  • BudgetLineNo: The budget line number to consider for the recalculation.

RecalcDistribution(Record KVSPSA Job Budget Line, Record KVSPSA Job Budget Line, Boolean, Integer) :#

Summary: Recalculate the distribution of a Job Budget Line. This procedure recalculates the distribution of a Job Budget Line based on the provided parameters. It checks if the distribution is active, if the line is not empty or temporary, and if the distribution level type is appropriate. If the conditions are met, it prompts the user for confirmation to carry out the recalculation. If the user confirms, it deletes old distribution entries, creates new distribution entries, and updates the Job Budget Line with the recalculated values. If the user chooses not to carry out the recalculation, it may update the distribution combined based on the selected option. If the Job Budget Line is empty or temporary, or if the distribution level type is not appropriate, the procedure exits without making any changes. If the distribution is not active, it exits without making any changes.

procedure RecalcDistribution(var JobBudgetLine: Record "KVSPSA Job Budget Line"; xJobBudgetLine: Record "KVSPSA Job Budget Line"; IsQuantity: Boolean; BudgetLineNo: Integer): 

Parameters:

  • JobBudgetLine: The Job Budget Line record to recalculate the distribution for.
  • xJobBudgetLine: The Job PSP Line record to compare with.
  • IsQuantity: Indicates whether the recalculation is based on quantity.
  • BudgetLineNo: The budget line number to consider for the recalculation.

SetCalledByResetPlanning(Boolean) :#

Summary: Use this procedure if the distribution is reset

procedure SetCalledByResetPlanning(CalledByResetPlanningValue: Boolean): 

Parameters:

  • CalledByResetPlanningValue:

SetSuppressMessage(Boolean) :#

Summary: Set this Value to true to supress recalc message

procedure SetSuppressMessage(SupressMessageValue: Boolean): 

Parameters:

  • SupressMessageValue: Supress Message

Events#

KVSPSAOnBeforeCarryOutRecalc(Boolean, Integer, Record KVSPSAJobPSPLine, Boolean, Integer) :#

Summary: Integration event raised before carrying out recalculation for Job PSP Line distribution.

[IntegrationEvent(false, false)]
local procedure KVSPSAOnBeforeCarryOutRecalc(var CarryOutRecalc: Boolean; var SelectedCarryOutDistribution: Integer; var JobPSPLine: Record "KVSPSAJobPSPLine"; IsQuantity: Boolean; BudgetLineNo: Integer): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSADistributionChangeMgt", 'KVSPSAOnBeforeCarryOutRecalc', '', false, false)]
local procedure DoSomethingKVSPSAOnBeforeCarryOutRecalc(var CarryOutRecalc: Boolean; var SelectedCarryOutDistribution: Integer; var JobPSPLine: Record "KVSPSAJobPSPLine"; IsQuantity: Boolean; BudgetLineNo: Integer)
begin
end;

Parameters:

  • CarryOutRecalc: Indicates whether to carry out the recalculation
  • SelectedCarryOutDistribution: The selected carry out distribution option
  • JobPSPLine: The Job PSP Line record being processed
  • IsQuantity: Indicates whether the recalculation is based on quantity
  • BudgetLineNo: The budget line number to consider for the recalculation

KVSPSAOnBeforeCarryOutRecalcBudget(Boolean, Integer, Record KVSPSA Job Budget Line, Boolean, Integer) :#

Summary: Integration event raised before carrying out recalculation for Job Budget Line distribution.

[IntegrationEvent(false, false)]
local procedure KVSPSAOnBeforeCarryOutRecalcBudget(var CarryOutRecalc: Boolean; var SelectedCarryOutDistribution: Integer; var JobBudgetLine: Record "KVSPSA Job Budget Line"; IsQuantity: Boolean; BudgetLineNo: Integer): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSADistributionChangeMgt", 'KVSPSAOnBeforeCarryOutRecalcBudget', '', false, false)]
local procedure DoSomethingKVSPSAOnBeforeCarryOutRecalcBudget(var CarryOutRecalc: Boolean; var SelectedCarryOutDistribution: Integer; var JobBudgetLine: Record "KVSPSA Job Budget Line"; IsQuantity: Boolean; BudgetLineNo: Integer)
begin
end;

Parameters:

  • CarryOutRecalc: Indicates whether to carry out the recalculation
  • SelectedCarryOutDistribution: The selected carry out distribution option
  • JobBudgetLine: The Job Budget Line record being processed
  • IsQuantity: Indicates whether the recalculation is based on quantity
  • BudgetLineNo: The budget line number to consider for the recalculation

KVSPSAOnBeforeRecalcDistributionBudget(Record KVSPSA Job Budget Line, Record KVSPSA Job Budget Line, Boolean, Integer, Boolean, Boolean) :#

Summary: Integration event raised before recalculating distribution for Job Budget Line.

[IntegrationEvent(false, false)]
local procedure KVSPSAOnBeforeRecalcDistributionBudget(var JobBudgetLine: Record "KVSPSA Job Budget Line"; xJobBudgetLine: Record "KVSPSA Job Budget Line"; IsQuantity: Boolean; BudgetLineNo: Integer; var SuppressMessage: Boolean; var SkipRecalc: Boolean): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSADistributionChangeMgt", 'KVSPSAOnBeforeRecalcDistributionBudget', '', false, false)]
local procedure DoSomethingKVSPSAOnBeforeRecalcDistributionBudget(var JobBudgetLine: Record "KVSPSA Job Budget Line"; xJobBudgetLine: Record "KVSPSA Job Budget Line"; IsQuantity: Boolean; BudgetLineNo: Integer; var SuppressMessage: Boolean; var SkipRecalc: Boolean)
begin
end;

Parameters:

  • JobBudgetLine: The Job Budget Line record to recalculate distribution for
  • xJobBudgetLine: The previous version of the Job Budget Line record for comparison
  • IsQuantity: Indicates whether the recalculation is based on quantity
  • BudgetLineNo: The budget line number to consider for the recalculation
  • SuppressMessage: Indicates whether to suppress confirmation messages
  • SkipRecalc: Indicates whether to skip the recalculation

KVSPSAOnBeforeRecalcDistributionPSP(Record KVSPSAJobPSPLine, Boolean, Integer, Boolean) :#

Summary: Integration event raised before recalculating distribution for Job PSP Line.

[IntegrationEvent(false, false)]
local procedure KVSPSAOnBeforeRecalcDistributionPSP(var JobPSPLine: Record "KVSPSAJobPSPLine"; IsQuantity: Boolean; BudgetLineNo: Integer; var SuppressMessage: Boolean): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSADistributionChangeMgt", 'KVSPSAOnBeforeRecalcDistributionPSP', '', false, false)]
local procedure DoSomethingKVSPSAOnBeforeRecalcDistributionPSP(var JobPSPLine: Record "KVSPSAJobPSPLine"; IsQuantity: Boolean; BudgetLineNo: Integer; var SuppressMessage: Boolean)
begin
end;

Parameters:

  • JobPSPLine: The Job PSP Line record to recalculate distribution for
  • IsQuantity: Indicates whether the recalculation is based on quantity
  • BudgetLineNo: The budget line number to consider for the recalculation
  • SuppressMessage: Indicates whether to suppress confirmation messages

KVSPSAOnAfterPrepareRecalcDistributionPSP(Record KVSPSAJobPSPLine, Boolean, Integer, Boolean, Text, Boolean, Boolean) :#

Summary: Integration event raised after preparing data for recalculating distribution of a Job PSP Line and before executing the standard confirmation / recalculation logic. Use this to adjust the message text, suppress user interaction or fully handle the scenario.

[IntegrationEvent(false, false)]
local procedure KVSPSAOnAfterPrepareRecalcDistributionPSP(var JobPSPLine: Record "KVSPSAJobPSPLine"; IsQuantity: Boolean; BudgetLineNo: Integer; var SuppressMessage: Boolean; var Msg: Text; var IsHandled: Boolean; var CalledByResetPlanning: Boolean): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSADistributionChangeMgt", 'KVSPSAOnAfterPrepareRecalcDistributionPSP', '', false, false)]
local procedure DoSomethingKVSPSAOnAfterPrepareRecalcDistributionPSP(var JobPSPLine: Record "KVSPSAJobPSPLine"; IsQuantity: Boolean; BudgetLineNo: Integer; var SuppressMessage: Boolean; var Msg: Text; var IsHandled: Boolean; var CalledByResetPlanning: Boolean)
begin
end;

Parameters:

  • JobPSPLine: The Job PSP Line record under recalculation consideration.
  • IsQuantity: Indicates whether the change was quantity-driven (affects user options).
  • BudgetLineNo: The related budget line number (0 if not budget line context).
  • SuppressMessage: Set to true to skip confirmation / StrMenu dialogs.
  • Msg: Confirmation / redistribution question text that can be replaced.
  • IsHandled: Set to true to bypass standard recalculation logic (caller exits).
  • CalledByResetPlanning: Indicates whether the call originated from a reset planning flow.

KVSPSAOnAfterPrepareRecalcDistributionBudget(Record KVSPSA Job Budget Line, Boolean, Integer, Boolean, Text, Boolean, Boolean) :#

Summary: Integration event raised after preparing data for recalculating distribution of a Job Budget Line and before executing the standard confirmation / recalculation logic. Subscribers can override the message, suppress dialogs or fully handle the recalculation.

[IntegrationEvent(false, false)]
local procedure KVSPSAOnAfterPrepareRecalcDistributionBudget(var JobBudgetLine: Record "KVSPSA Job Budget Line"; IsQuantity: Boolean; BudgetLineNo: Integer; var SuppressMessage: Boolean; var Msg: Text; var IsHandled: Boolean; var CalledByResetPlanning: Boolean): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSADistributionChangeMgt", 'KVSPSAOnAfterPrepareRecalcDistributionBudget', '', false, false)]
local procedure DoSomethingKVSPSAOnAfterPrepareRecalcDistributionBudget(var JobBudgetLine: Record "KVSPSA Job Budget Line"; IsQuantity: Boolean; BudgetLineNo: Integer; var SuppressMessage: Boolean; var Msg: Text; var IsHandled: Boolean; var CalledByResetPlanning: Boolean)
begin
end;

Parameters:

  • JobBudgetLine: The Job Budget Line record to potentially recalculate.
  • IsQuantity: True if quantity change triggered recalc; impacts StrMenu behavior.
  • BudgetLineNo: The nested / dependent budget line number if applicable.
  • SuppressMessage: Set to true to suppress confirmation prompts.
  • Msg: Confirmation / redistribution question text that can be customized.
  • IsHandled: Set to true to abort further standard processing.
  • CalledByResetPlanning: True if called from reset planning context to distinguish logic.