Link subform to subform

SteveDesmedt
Member Posts: 3
Hi to all,
I want to link a subform to a subform by using the property providerID.
Both subforms are used for data entry.
So i've created the following objects :
Maintable.al
Subtable1.al
Subtable2.al
MainPage.al
Sub1Page.al
Sub2Page.al
I have two major problems. When the delayedinsert = false on the first subpage (as in the code above), i receive a page notification

If i set the property delayedinsert = true on the first subpage, and the focus is set to the second subform, the line no. is not yet initialized, so i lose the link between those two tables

Hopefully someone has a solution for this.
Thanks in advance
Kind regards
I want to link a subform to a subform by using the property providerID.
Both subforms are used for data entry.
So i've created the following objects :
Maintable.al
table 50132 "Main Table" { Caption = 'Main'; fields { field(2; "No."; Code[20]) { Caption = 'No.'; DataClassification = CustomerContent; } field(3; "Description"; Text[100]) { Caption = 'Description'; DataClassification = CustomerContent; } field(4; "Description 2"; Text[50]) { Caption = 'Description 2'; DataClassification = CustomerContent; } } keys { key(Key1; "No.") { Clustered = true; } } }
Subtable1.al
table 50134 "Sub 1 Table" { Caption = 'Sub1'; fields { field(2; "Document No."; Code[20]) { DataClassification = CustomerContent; Caption = 'Document No.'; } field(3; "Line No."; Integer) { DataClassification = CustomerContent; Caption = 'Line No.'; } field(22; Description; Text[100]) { DataClassification = CustomerContent; Caption = 'Description'; } field(23; "Description 2"; Text[100]) { DataClassification = CustomerContent; Caption = 'Description'; } } keys { key(Key1; "Document No.", "Line No.") { Clustered = true; } } }
Subtable2.al
table 50137 "Sub 2 Table" { Caption = 'SUB2'; fields { field(2; "Document No."; Code[20]) { Caption = 'Document No.'; } field(3; "Document Line No."; Integer) { Caption = 'Document Line No.'; } field(4; "Line No."; Integer) { Caption = 'Line No.'; } field(70; Description; Text[100]) { DataClassification = CustomerContent; Caption = 'Description'; } field(71; "Description 2"; Text[100]) { DataClassification = CustomerContent; Caption = 'Description'; } } keys { key(Key1; "Document No.", "Document Line No.", "Line No.") { Clustered = true; } } }
MainPage.al
page 50133 "Main Page" { Caption = 'Main PAge'; PageType = Document; RefreshOnActivate = true; SourceTable = "Main Table"; layout { area(content) { group(General) { Caption = 'General'; field("No."; "No.") { ApplicationArea = All; } field("Description"; "Description") { ApplicationArea = All; ShowMandatory = true; } field("Description 2"; "Description 2") { ApplicationArea = All; ShowMandatory = true; } } part(Sub1Page; "Sub 1 Page") { ApplicationArea = All; SubPageLink = "Document No." = FIELD("No."); UpdatePropagation = Both; } part(Sub2Page; "Sub 2 Page") { ApplicationArea = All; Provider = Sub1Page; SubPageLink = "Document No." = FIELD("Document No."), "Document Line No." = FIELD("Line No."); UpdatePropagation = Both; } } } }
Sub1Page.al
page 50136 "Sub 1 Page" { AutoSplitKey = true; Caption = 'Lines'; //DelayedInsert = true; LinksAllowed = false; MultipleNewLines = true; PageType = ListPart; SourceTable = "Sub 1 Table"; layout { area(content) { repeater(Control1) { ShowCaption = false; field("Document No."; "Document No.") { ApplicationArea = All; } field("Line No."; "Line No.") { ApplicationArea = All; } field(Description; Description) { ApplicationArea = All; } field("Description 2"; "Description 2") { ApplicationArea = All; } } } } }
Sub2Page.al
page 50139 "Sub 2 Page" { AutoSplitKey = true; Caption = 'SubPage2'; DelayedInsert = true; LinksAllowed = false; MultipleNewLines = true; PageType = ListPart; SourceTable = "Sub 2 Table"; layout { area(content) { repeater(Control1) { ShowCaption = false; field("Document No."; "Document No.") { ApplicationArea = All; } field("Line No."; "Line No.") { ApplicationArea = All; } field("document Line No."; "document Line No.") { ApplicationArea = All; } field(Description; Description) { ApplicationArea = All; } field("Description 2"; "Description 2") { ApplicationArea = All; } } } } }
I have two major problems. When the delayedinsert = false on the first subpage (as in the code above), i receive a page notification

If i set the property delayedinsert = true on the first subpage, and the focus is set to the second subform, the line no. is not yet initialized, so i lose the link between those two tables

Hopefully someone has a solution for this.
Thanks in advance
Kind regards
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions