How to insert the header No. in the subform
poppins
Member Posts: 647
Hi everyone,
I am trying to create a new page with a header and a subform.
In the source table of the subform I created a field named "Group No." and I set the TableRelation to "myTable"."No."
In the header page I set the SubPageLink to "Group No."=FIELD("No.").
When I insert a line in the subform, I look at the table and find the field "Group No."(which is supposed to contain the header No.)
empty....
What shall I do to populate this field?
I looked into tables 36 and 37 with pages 42 and 46 but couldn't figure it out...
Can anyone help me on how to proceed???
Thanks in advance
I am trying to create a new page with a header and a subform.
In the source table of the subform I created a field named "Group No." and I set the TableRelation to "myTable"."No."
In the header page I set the SubPageLink to "Group No."=FIELD("No.").
When I insert a line in the subform, I look at the table and find the field "Group No."(which is supposed to contain the header No.)
empty....
What shall I do to populate this field?
I looked into tables 36 and 37 with pages 42 and 46 but couldn't figure it out...
Can anyone help me on how to proceed???
Thanks in advance
0
Comments
-
It's done via the primairy key fields. The primairy key of the records in the subpage must be the pk of the main page + a line number.0
-
Mark Brummel wrote:It's done via the primairy key fields. The primairy key of the records in the subpage must be the pk of the main page + a line number.
Infact, I added the field to the key and now the header no. is being inserted in the subform but when I insert many lines in the subform, only the last one is being stored in the table...
Why is that?0 -
Did you set the AutoSplitKey property of Subform True?0
-
Look again at the sales header & sales line tables.
see the key for the sales line is Document Type,Document No.,Line No.
Do you have a line no field? how are you having it increment?0 -
What is the Data Type of your last field in the key?
It should be integer as in sales line table.0 -
Savatage wrote:Look again at the sales header & sales line tables.
see the key for the sales line is Document Type,Document No.,Line No.
Do you have a line no field? how are you having it increment?
I have a line no. field and I am incrementing it manually in the subform...0 -
No need to write even a single line code just set the data type of that field integer and set the autosplit property to yes.0
-
what do you mean by inserting. are you manually entering lines or is this some kind of import?
and you removed the line no increment code?
and you completely got out of the form/page and went back in before "inserting again"?0 -
Savatage wrote:what do you mean by inserting. are you manually entering lines or is this some kind of import?
and you removed the line no increment code?
and you completely got out of the form/page and went back in before "inserting again"?
I am manually entering the line no.
I didn't add any line no. incrementing code and I didn't remove any increment code....are you talking about standard code?where can I find it?
Infact, I did what vijay_g said...it works fine with only one line, but if I try to add another one, I get the following error message:The line already exists: "No."=NT10000, Line No.=10000
Whath shall I do?0 -
did you set the autosplitkey to yes on the header or the subform?
and you have setup the subformlink & subformid properly?0 -
-
I did set the Autosplit key in the subform to Yes and the last field in the primary key to type Integer.Savatage wrote:did you set the autosplitkey to yes on the header or the subform?
and you have setup the subformlink & subformid properly?
In the header, I set the PagePartID to the name of the subform
I set the SubPageLink to "Group No."=FIELD("No.") (where "No." is the header no. and "Group No." is the corresponding field in the subform).
Infact, when I try to insert more than one line at a same time, it looks like the line no. is not being incremented...but if I create one line at a time, close the page, open it again and add another line, the line no. is incremented (20000) and no error message is generated...
Why is that?0 -
Sounds strange that it works if you close the page between each item being entered.
Did you play with other properties and didn't change them back?
Have you added any code somewhere?
Do you have the delayed insert property = yes?0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 328 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
