Skip to content

KVSPSACopyPSPTemplateMgmt#

Procedures#

CopyBudgetLinefromTemplate(Record KVSPSAJobPSPLine, Record KVSPSA Job BudgetLine Template, Record KVSPSA Job Budget Line) :#

Summary: The Procedure CopyBudgetLinefromTemplate copies a budget line from a template to a new job budget line. It initializes the new job budget line with values from the template and sets various fields such as "Job No.", "Job Budget Name", "Version No.", and others. It also handles the distribution fields if the Jobs Setup is active, and merges dimension sets. After copying, it modifies the new job budget line and sets the global modified job budget line variable.

procedure CopyBudgetLinefromTemplate(JobPSPLine: Record "KVSPSAJobPSPLine"; JobBudgetLineTemplate: Record "KVSPSA Job BudgetLine Template"; var JobBudgetLine: Record "KVSPSA Job Budget Line"): 

Parameters:

  • JobPSPLine: The related Job PSP Line
  • JobBudgetLineTemplate: The Job Budget Line Template to copy from
  • JobBudgetLine: The new Job Budget Line will be passed by call by reference

CopySinglePSPLineFromTemplate(Record KVSPSAJobPSPHeader, Record KVSPSA Job PSP Line Template, Integer, Code[20], Code[20], Code[20], Date, Date) :#

Summary: The Procedure CopySinglePSPLineFromTemplate copies a single PSP line from a template to a new job PSP line. It initializes the new job PSP line with values from the template and sets various fields such as "Job No.", "Job Budget Name", "Version No.", and others. It also handles the distribution fields if the Jobs Setup is active, and merges dimension sets. After copying, it modifies the new job PSP line. It also copies budget lines from the template to the new job PSP line. The procedure is used to create a new PSP line based on a template, allowing for customization of phase, task, and step codes, as well as start and end dates.

procedure CopySinglePSPLineFromTemplate(JobPSPHeader: Record "KVSPSAJobPSPHeader"; JobPSPLineTemplate: Record "KVSPSA Job PSP Line Template"; NextLineNo: Integer; NewPhaseCode: Code[20]; NewTaskCode: Code[20]; NewStepCode: Code[20]; NewStartDate: Date; NewEndDate: Date): 

Parameters:

  • JobPSPHeader: The Job PSP Header to which the new line will be added
  • JobPSPLineTemplate: The Job PSP Line Template to copy from
  • NextLineNo: The next line number for the new PSP line
  • NewPhaseCode: The new phase code for the PSP line
  • NewTaskCode: The new task code for the PSP line
  • NewStepCode: The new step code for the PSP line
  • NewStartDate: The new start date for the PSP line
  • NewEndDate: The new end date for the PSP line

ExplodeCatalog(Record KVSPSAJobPSPLine) :#

Summary: The procedure ExplodeCatalog takes a JobPSPLine record and explodes its catalog. It retrieves the job PSP header associated with the line, checks for a template, and then creates new job PSP lines based on the template. It calculates the step size for the new lines and copies the PSP line from the template to the new job PSP lines. It also handles the copying of WBS calculation mappings from the template line to the new lines. After copying all lines, it finishes the process by updating the job PSP header and transferring WBS template line links for marked job PSP lines.

procedure ExplodeCatalog(JobPSPLine: Record "KVSPSAJobPSPLine"): 

Parameters:

  • JobPSPLine: The Job PSP Line to be exploded

InsertFirstPSPFromTemplate(Record Job) :#

Summary: The procedure InsertFirstPSPFromTemplate inserts the first PSP from a template into a job. It checks if the PSP creation is confirmed, retrieves the job setup and module setup records, and checks for distribution. It then initializes a new PSP header, checks if there are existing PSP lines, and if not, it creates a new PSP header. It retrieves the job template based on the PSP template number, and if the automatic block is set, it creates a block PSP line from the template and explodes it. It then copies PSP lines from the template to the new PSP header, creating new lines with the next line number. It also copies the PSP calculation mapping from the template to the new PSP header. If the automatic block is set after copying the lines, it creates another block PSP line from the template and explodes it. Finally, it calls the after copied event, finishes the PSP header, transfers WBS template line links for marked job PSP lines, and informs the user.

procedure InsertFirstPSPFromTemplate(var Job: Record "Job"): 

Parameters:

  • Job: The Job record to which the PSP will be inserted.

SetCommitIsSupressed(Boolean) :#

Summary: The procedure SetCommitIsSupressed sets the global variable GlobalCommitIsSupressed to the value of NewCommitIsSupressed. Thie variable GlobalCommitIsSupressed is used in the finished procedure to determine whether to commit changes or not.

procedure SetCommitIsSupressed(NewCommitIsSupressed: Boolean): 

Parameters:

  • NewCommitIsSupressed: The new value for the GlobalCommitIsSupressed variable.

SetHideConfirm(Boolean) :#

Summary: The procedure SetHideConfirm sets the global variable GlobalHideConfirm to the value of NewHideConfirm. This variable is used to determine whether to hide confirmation messages in the user interface. It is set to true the position no. will be calculated automatically without user confirmation.

procedure SetHideConfirm(NewHideConfirm: Boolean): 

Parameters:

  • NewHideConfirm: The new value for the GlobalHideConfirm variable.

SetHideMessage(Boolean) :#

Summary: The procedure SetHideMessage sets the global variable GlobalHideMessage to the value of NewHideMessage. This variable is used to determine whether to hide informational messages in the user interface.

procedure SetHideMessage(NewHideMessage: Boolean): 

Parameters:

  • NewHideMessage: The new value for the GlobalHideMessage variable.

Events#

KVSPSAOnAfterActivatePSPHeader(Record Job, Record KVSPSAJobPSPHeader) :#

Summary: Integration event that is triggered after a PSP header has been activated.

[IntegrationEvent(false, false)]
local procedure KVSPSAOnAfterActivatePSPHeader(var Job: Record "Job"; var JobPSPHeader: Record "KVSPSAJobPSPHeader"): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSACopyPSPTemplateMgmt", 'KVSPSAOnAfterActivatePSPHeader', '', false, false)]
local procedure DoSomethingKVSPSAOnAfterActivatePSPHeader(var Job: Record "Job"; var JobPSPHeader: Record "KVSPSAJobPSPHeader")
begin
end;

Parameters:

  • Job: The job record associated with the PSP header
  • JobPSPHeader: The PSP header that was activated

KVSPSAOnAfterCopiedAllPSPLinesInAddPSP(Record KVSPSAJobPSPHeader) :#

Summary: Integration event that is triggered after all PSP lines have been copied in the AddPSP process.

[IntegrationEvent(false, false)]
local procedure KVSPSAOnAfterCopiedAllPSPLinesInAddPSP(var JobPSPHeader: Record "KVSPSAJobPSPHeader"): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSACopyPSPTemplateMgmt", 'KVSPSAOnAfterCopiedAllPSPLinesInAddPSP', '', false, false)]
local procedure DoSomethingKVSPSAOnAfterCopiedAllPSPLinesInAddPSP(var JobPSPHeader: Record "KVSPSAJobPSPHeader")
begin
end;

Parameters:

  • JobPSPHeader: The PSP header to which the lines were added

KVSPSAOnAfterCopiedAllPSPLinesInExplodeCatalog(Record KVSPSAJobPSPHeader) :#

Summary: Integration event that is triggered after all PSP lines have been copied in the ExplodeCatalog process.

[IntegrationEvent(false, false)]
local procedure KVSPSAOnAfterCopiedAllPSPLinesInExplodeCatalog(var JobPSPHeader: Record "KVSPSAJobPSPHeader"): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSACopyPSPTemplateMgmt", 'KVSPSAOnAfterCopiedAllPSPLinesInExplodeCatalog', '', false, false)]
local procedure DoSomethingKVSPSAOnAfterCopiedAllPSPLinesInExplodeCatalog(var JobPSPHeader: Record "KVSPSAJobPSPHeader")
begin
end;

Parameters:

  • JobPSPHeader: The PSP header to which the lines were added during catalog explosion

KVSPSAOnAfterCopiedAllPSPLinesInInsertFirstPSPFromTemplate(Record KVSPSAJobPSPHeader) :#

Summary: Integration event that is triggered after all PSP lines have been copied in the InsertFirstPSPFromTemplate process.

[IntegrationEvent(false, false)]
local procedure KVSPSAOnAfterCopiedAllPSPLinesInInsertFirstPSPFromTemplate(var JobPSPHeader: Record "KVSPSAJobPSPHeader"): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSACopyPSPTemplateMgmt", 'KVSPSAOnAfterCopiedAllPSPLinesInInsertFirstPSPFromTemplate', '', false, false)]
local procedure DoSomethingKVSPSAOnAfterCopiedAllPSPLinesInInsertFirstPSPFromTemplate(var JobPSPHeader: Record "KVSPSAJobPSPHeader")
begin
end;

Parameters:

  • JobPSPHeader: The PSP header to which the first PSP lines were inserted from template

KVSPSAOnAfterCopiedBudgetLineFromTemplate(Record KVSPSA Job BudgetLine Template, Record KVSPSA Job Budget Line) :#

Summary: Integration event that is triggered after a budget line has been copied from a template.

[IntegrationEvent(false, false)]
local procedure KVSPSAOnAfterCopiedBudgetLineFromTemplate(var FromJobBudgetLineTemplate: Record "KVSPSA Job BudgetLine Template"; var ToJobBudgetLine: Record "KVSPSA Job Budget Line"): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSACopyPSPTemplateMgmt", 'KVSPSAOnAfterCopiedBudgetLineFromTemplate', '', false, false)]
local procedure DoSomethingKVSPSAOnAfterCopiedBudgetLineFromTemplate(var FromJobBudgetLineTemplate: Record "KVSPSA Job BudgetLine Template"; var ToJobBudgetLine: Record "KVSPSA Job Budget Line")
begin
end;

Parameters:

  • FromJobBudgetLineTemplate: The source job budget line template that was copied
  • ToJobBudgetLine: The target job budget line that was created

KVSPSAOnAfterCopyBudgetLineFieldsFromTemplate(Record KVSPSA Job BudgetLine Template, Record KVSPSA Job Budget Line) :#

Summary: Integration event that is triggered after budget line fields have been copied from a template.

[IntegrationEvent(false, false)]
local procedure KVSPSAOnAfterCopyBudgetLineFieldsFromTemplate(var FromJobBudgetLineTemplate: Record "KVSPSA Job BudgetLine Template"; var ToJobBudgetLine: Record "KVSPSA Job Budget Line"): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSACopyPSPTemplateMgmt", 'KVSPSAOnAfterCopyBudgetLineFieldsFromTemplate', '', false, false)]
local procedure DoSomethingKVSPSAOnAfterCopyBudgetLineFieldsFromTemplate(var FromJobBudgetLineTemplate: Record "KVSPSA Job BudgetLine Template"; var ToJobBudgetLine: Record "KVSPSA Job Budget Line")
begin
end;

Parameters:

  • FromJobBudgetLineTemplate: The source job budget line template that provided the field values
  • ToJobBudgetLine: The target job budget line that received the copied field values

KVSPSAOnAfterCopyPSPLineFieldsFromTemplate(Record KVSPSA Job PSP Line Template, Record KVSPSAJobPSPLine) :#

Summary: Integration event that is triggered after PSP line fields have been copied from a template.

[IntegrationEvent(false, false)]
local procedure KVSPSAOnAfterCopyPSPLineFieldsFromTemplate(var FromJobPSPLineTemplate: Record "KVSPSA Job PSP Line Template"; var ToJobPSPLine: Record "KVSPSAJobPSPLine"): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSACopyPSPTemplateMgmt", 'KVSPSAOnAfterCopyPSPLineFieldsFromTemplate', '', false, false)]
local procedure DoSomethingKVSPSAOnAfterCopyPSPLineFieldsFromTemplate(var FromJobPSPLineTemplate: Record "KVSPSA Job PSP Line Template"; var ToJobPSPLine: Record "KVSPSAJobPSPLine")
begin
end;

Parameters:

  • FromJobPSPLineTemplate: The source PSP line template that provided the field values
  • ToJobPSPLine: The target PSP line that received the copied field values

KVSPSAOnAfterCopyPSPLineFromTemplate(Record KVSPSA Job PSP Line Template, Record KVSPSAJobPSPLine) :#

Summary: Integration event that is triggered after a PSP line has been copied from a template.

[IntegrationEvent(false, false)]
local procedure KVSPSAOnAfterCopyPSPLineFromTemplate(var JobPSPLineTemplate: Record "KVSPSA Job PSP Line Template"; var NewJobPSPLine: Record "KVSPSAJobPSPLine"): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSACopyPSPTemplateMgmt", 'KVSPSAOnAfterCopyPSPLineFromTemplate', '', false, false)]
local procedure DoSomethingKVSPSAOnAfterCopyPSPLineFromTemplate(var JobPSPLineTemplate: Record "KVSPSA Job PSP Line Template"; var NewJobPSPLine: Record "KVSPSAJobPSPLine")
begin
end;

Parameters:

  • JobPSPLineTemplate: The source PSP line template that was copied
  • NewJobPSPLine: The new PSP line that was created from the template

KVSPSAOnAfterCopyPSPLineTemplateSkill(Record KVSPSAPSP Line Template Skill, Record KVSPSAPSP Line Skill) :#

Summary: Integration event that is triggered after a PSP line template skill has been copied to a PSP line skill.

[IntegrationEvent(false, false)]
local procedure KVSPSAOnAfterCopyPSPLineTemplateSkill(var FromPSPLineTemplateSkill: Record "KVSPSAPSP Line Template Skill"; var ToPSPLineSkill: Record "KVSPSAPSP Line Skill"): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSACopyPSPTemplateMgmt", 'KVSPSAOnAfterCopyPSPLineTemplateSkill', '', false, false)]
local procedure DoSomethingKVSPSAOnAfterCopyPSPLineTemplateSkill(var FromPSPLineTemplateSkill: Record "KVSPSAPSP Line Template Skill"; var ToPSPLineSkill: Record "KVSPSAPSP Line Skill")
begin
end;

Parameters:

  • FromPSPLineTemplateSkill: The source PSP line template skill that was copied
  • ToPSPLineSkill: The target PSP line skill that was created

KVSPSAOnBeforeAskForPositionNumbering(Boolean, Boolean, Boolean) :#

Summary: Integration event that is triggered before asking for position numbering to allow customization of the process.

[IntegrationEvent(false, false)]
local procedure KVSPSAOnBeforeAskForPositionNumbering(AddedToExistingLines: Boolean; var WithPositionNumbering: Boolean; var IsHandled: Boolean): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSACopyPSPTemplateMgmt", 'KVSPSAOnBeforeAskForPositionNumbering', '', false, false)]
local procedure DoSomethingKVSPSAOnBeforeAskForPositionNumbering(AddedToExistingLines: Boolean; var WithPositionNumbering: Boolean; var IsHandled: Boolean)
begin
end;

Parameters:

  • AddedToExistingLines: Indicates whether lines were added to existing lines
  • WithPositionNumbering: Output parameter indicating whether position numbering should be performed
  • IsHandled: Flag to indicate if the event has been handled by subscribers

KVSPSAOnBeforeCreatePSP(Record Job, Boolean, Boolean) :#

Summary: Integration event that is triggered before creating a PSP to allow customization of the PSP creation process.

[IntegrationEvent(false, false)]
local procedure KVSPSAOnBeforeCreatePSP(var Job: Record "Job"; var IsHandled: Boolean; var ShouldBeCreated: Boolean): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSACopyPSPTemplateMgmt", 'KVSPSAOnBeforeCreatePSP', '', false, false)]
local procedure DoSomethingKVSPSAOnBeforeCreatePSP(var Job: Record "Job"; var IsHandled: Boolean; var ShouldBeCreated: Boolean)
begin
end;

Parameters:

  • Job: The job for which the PSP is being created
  • IsHandled: Flag to indicate if the event has been handled by subscribers
  • ShouldBeCreated: Output parameter indicating whether the PSP should be created

KVSPSAOnBetweenCopyLinesAndStartCalculation(Record KVSPSA Job PSP Line Template, Record KVSPSAJobPSPLine) :#

Summary: Integration event that is triggered between copying lines and starting calculation processes.

[IntegrationEvent(false, false)]
local procedure KVSPSAOnBetweenCopyLinesAndStartCalculation(var JobPSPLineTemplate: Record "KVSPSA Job PSP Line Template"; var NewJobPSPLine: Record "KVSPSAJobPSPLine"): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSPSACopyPSPTemplateMgmt", 'KVSPSAOnBetweenCopyLinesAndStartCalculation', '', false, false)]
local procedure DoSomethingKVSPSAOnBetweenCopyLinesAndStartCalculation(var JobPSPLineTemplate: Record "KVSPSA Job PSP Line Template"; var NewJobPSPLine: Record "KVSPSAJobPSPLine")
begin
end;

Parameters:

  • JobPSPLineTemplate: The PSP line template that was copied
  • NewJobPSPLine: The new PSP line that was created from the template