table 50108 "Production Time Log Header" { DataClassification = ToBeClassified; fields { field(50000; "Entry No"; Integer) { DataClassification = CustomerContent; } field(50002; "Production No."; Code[20]) { DataClassification = ToBeClassified; } field(50003; "Total"; Decimal) { FieldClass = FlowField; CalcFormula = sum ("Production Time Log Lines"."Run Time" where("Production No." = field("Production No."))); } } keys { key(PK; "Entry No") { Clustered = true; } } var myInt: Integer; trigger OnInsert() var recPTLH: Record "Production Time Log Header"; begin Clear(recPTLH); IF recPTLH.FindLast() then "Entry No" := recPTLH."Entry No" + 1 else "Entry No" := 1; end; }
table 50113 "Production Time Log Lines" { DataClassification = ToBeClassified; fields { field(50000; "Entry No"; Integer) { DataClassification = CustomerContent; } field(50001; "Line No."; Integer) { DataClassification = CustomerContent; Editable = false; } field(50002; "Production No."; Code[20]) { DataClassification = CustomerContent; // TableRelation = "Production Time Log Header"."Production No." where("Entry No" = field("Entry No")); // ValidateTableRelation = true; } field(50003; "Process"; Code[20]) { DataClassification = CustomerContent; TableRelation = "Work Center"; } field(50012; "Run Time"; Decimal) { DataClassification = CustomerContent; } } keys { key(PK; "Entry No", "Line No.") { Clustered = true; } key(T; "Run Time") { MaintainSqlIndex = false; MaintainSiftIndex = true; SumIndexFields = "Run Time"; } } var myInt: Integer; trigger OnInsert() begin end; }
page 50111 "Production Time Log Card" { PageType = Document; ApplicationArea = All; UsageCategory = Administration; SourceTable = "Production Time Log Header"; RefreshOnActivate = true; layout { area(Content) { group(General) { field("Entry No"; "Entry No") { ApplicationArea = All; } field("Production No."; "Production No.") { ApplicationArea = All; TableRelation = "Production Order"."No."; } field(Total; Total) { ApplicationArea = All; } } part(Line; "Production Time Log Subform") { Visible = true; ShowFilter = true; UpdatePropagation = Both; SubPageLink = "Entry No" = field("Entry No"); } } } }
page 50112 "Production Time Log Subform" { PageType = ListPart; ApplicationArea = All; UsageCategory = Administration; SourceTable = "Production Time Log Lines"; AutoSplitKey = true; DelayedInsert = true; MultipleNewLines = true; layout { area(Content) { repeater(Line) { field(Process; Process) { ApplicationArea = All; } field(Runtime; Runtime) { ApplicationArea = All; } } } } } }
Answers