Set Line No in table

jorgito
Member Posts: 115
Hi all.
I have created 2 new tables Header and Line.
In the Line table I have added a Header No. field that links the Line records to the Header records. I have added a Line No. field in the Line table.
How do I set the Line No in the Line table to get numbers 10000, 20000 etc.
I tried looking at the Sales Header and Sales Line tables to get some idea but I can't find the part that Line No is initialized.
Any ideas?
Thanks
Jorgito
I have created 2 new tables Header and Line.
In the Line table I have added a Header No. field that links the Line records to the Header records. I have added a Line No. field in the Line table.
How do I set the Line No in the Line table to get numbers 10000, 20000 etc.
I tried looking at the Sales Header and Sales Line tables to get some idea but I can't find the part that Line No is initialized.
Any ideas?
Thanks
Jorgito
0
Answers
-
The last primary key field of your line must be an integer type field (call it 'Line No.' like in std Navision). Then on the subform, where you put the lines, you set the AutoSplitKey property to Yes, and Navision will take care of the line number automatically. Magic0
-
Set Line No. field's property "Auto Increment" to yes.
should solve your purposeRegards
R.K.S
Consultant ERP0 -
No that is not the way it works. Auto-increment is not the way that the sales line number is incremented. Use the AutoSplitKey feature of the line form.0
-
I noticed that the AutoSplitKey creates the next Line No., but also the DelayedInsert does not insert the new line until values have been entered.
Thanx everyone
Jorgito0 -
Another relative question.
In the Prod. Order Line table (5406), I am trying to insert the Prod. Order Components automatically when the user selects the Item No. However, when I am inserting a new record, the Line No. of the Prod. Order Line table is still 0. So I cannot insert new lines in the Prod. Order Component table. How should I overcome this problem?
Thanx,
Jorgito0 -
Not an elegant solution, but the on the form OnAfterValidate trigger for Item No. should do the trick. However, it would be nicer to do it in the table. Are you sure Item No. - OnValidate does not work in the table?
Do It Yourself is they key. Standard code might work - your code surely works.0 -
Thanx a lot, BlackTiger. This solved my problem!!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