copy form ID to records in subform
tompynation
Member Posts: 398
I've created a form where a user can insert a picture...
On this form i have a subform with a table on it.
When i now insert a new line in the table, i would like to have the form ID also inserted in the subform's table.
How do i transfer my Form ID to my subform record(s)?
On this form i have a subform with a table on it.
When i now insert a new line in the table, i would like to have the form ID also inserted in the subform's table.
How do i transfer my Form ID to my subform record(s)?
0
Comments
-
i found out how to transfer the ID, but something is going wrong when i go to the next record in my form... the subform lines from my previous record keep standing in my subform untill i click on it a few times.
And i can only insert 1 record in my subform table?
This is my code in my subform:Form - OnNextRecord(Steps : Integer) : Integer TextLayoutRec.SETRANGE(TextLayoutRec."Remark ID", "Remark ID"); CurrForm.SpecialRemarkLines.FORM.SETTABLEVIEW(TextLayoutRec); CurrForm.SpecialRemarkLines.FORM.UPDATECONTROLS; Form - OnAfterGetRecord() CurrForm.SpecialRemarkLines.FORM.SetRemarkID("Remark ID"); TextLayoutRec.SETRANGE(TextLayoutRec."Remark ID", "Remark ID"); CurrForm.SpecialRemarkLines.FORM.SETTABLEVIEW(TextLayoutRec);
And this is the code inside my subform:Form - OnActivateForm() MESSAGE('onactivateform'); "Remark ID" := RemarkID; SetRemarkID(FormID : Integer) RemarkID := FormID;
This is the table used by my main form:
Enabled Field No. Field Name Data Type Length Description
Yes 1 Remark ID Integer
Yes 3 Picture BLOB
And this is the table in my subform:
Enabled Field No. Field Name Data Type Length Description
Yes 1 Primary Key Integer
Yes 2 Align Option
Yes 3 Wide Boolean
Yes 4 High Boolean
Yes 5 Bold Boolean
Yes 6 Italic Boolean
Yes 7 Text Text 250
Yes 9 Remark ID Integer
Yes 10 Line No. Integer
And this is my form to get a better look of what it does:
0 -
If you just want to populate fields on subform which are used to link the records to the header record (displayed on the main form) and these fields are not part of Primary key (else they are filled automatically), you can use the PopulateAllFields property on the subform. See on-line help for more info.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
- 322 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
