page 81008 "DET Destroy Instance"
{
PageType = List;
ApplicationArea = All;
UsageCategory = Lists;
SourceTable = "DET Some Table";
SourceTableTemporary = true;
Caption = 'Destroy Instance';
layout
{
area(Content)
{
repeater(Repgroup)
{
field("Entry No."; Rec."Entry No.")
{
ToolTip = 'Specifies the value of the Entry No. field.';
}
field(Description; Rec.Description)
{
ToolTip = 'Specifies the value of the Description field.';
}
}
}
}
actions
{
area(Processing)
{
action("DET DestroyInstance")
{
ApplicationArea = All;
Caption = 'Destroy Instance';
ToolTip = 'Destroy Instance';
Image = DeleteExpiredComponents;
trigger OnAction()
begin
Execute();
end;
}
}
area(Promoted)
{
actionref("DET DestroyInstance_promoted"; "DET DestroyInstance")
{
}
}
}
procedure Execute()
var
SessionIndex, StartIndex, EndIndex : Integer;
ListOfParts: List of [Integer];
i: Integer;
ParallelSessionCount: Integer;
begin
ParallelSessionCount := 6;
StartIndex := 1;
ListOfParts.Add(111);
ListOfParts.Add(112);
ListOfParts.Add(113);
ListOfParts.Add(114);
ListOfParts.Add(115);
ListOfParts.Add(112);
Rec.Init();
Rec."Entry No." := 1;
Rec.Insert();
for i := 1 to ParallelSessionCount do begin
EndIndex := StartIndex + ListOfParts.Get(i) - 1;
Rec."Start Index" := StartIndex;
Rec."End Index" := EndIndex;
if i > 1 then
StartSession(SessionIndex, Codeunit::"DET Insert Record Range", CompanyName(), Rec);
StartIndex := EndIndex + 1;
end;
end;
}
codeunit 81002 "DET Insert Record Range"
{
TableNo = "DET Some Table";
trigger OnRun()
var
TempRecRef: RecordRef;
FieldRef: FieldRef;
StartIndex, EndIndex : Integer;
i, j : Integer;
begin
Sleep(500);
TempRecRef.GetTable(Rec);
StartIndex := Rec."Start Index";
EndIndex := Rec."End Index";
for i := StartIndex to EndIndex do begin
TempRecRef.Init();
for j := 1 to 2 do begin
FieldRef := TempRecRef.Field(j);
FieldRef.Value(i);
end;
TempRecRef.Insert();
end;
end;
}
table 81003 "DET Some Table"
{
DataClassification = CustomerContent;
fields
{
field(1; "Entry No."; Integer)
{
DataClassification = CustomerContent;
Caption = 'Entry No.';
}
field(2; Description; Text[100])
{
DataClassification = CustomerContent;
Caption = 'Description';
}
field(3; "Start Index"; Integer)
{
DataClassification = CustomerContent;
Caption = 'Start Index';
}
field(4; "End Index"; Integer)
{
DataClassification = CustomerContent;
Caption = 'End Index';
}
}
keys
{
key(PK; "Entry No.")
{
Clustered = true;
}
}
}