Sales Sub Line
Roelof
Member Posts: 377
I need some help on this one.
I need to find a trigger what gives me the 'Line No.' if I'm creating a new SalesLine, with form property: DelayedInsert = True.
The problem what I have is that Navision doesn't have the 'Line No.' available at the time that you create a new salesline with Delayed insert = true. The line will only be created if you go to the next line.
I need the lineNo field in order to create a Subline, attached to the salesline.
I tried triggers in the SalesLine form aswell. Just nothing works.
Please help.
Thanks,
Roelof de Jong.
I need to find a trigger what gives me the 'Line No.' if I'm creating a new SalesLine, with form property: DelayedInsert = True.
The problem what I have is that Navision doesn't have the 'Line No.' available at the time that you create a new salesline with Delayed insert = true. The line will only be created if you go to the next line.
I need the lineNo field in order to create a Subline, attached to the salesline.
I tried triggers in the SalesLine form aswell. Just nothing works.
Please help.
Thanks,
Roelof de Jong.
Roelof de Jonghttp://www.wye.com
0
Comments
-
Hello,
Please check the AutoSplitKey on the form property. Make sure it's set to YES.
Also, make sure the Line No. is the last key on your primary key.Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0 -
The following triggers can 'see' the new Line No:
- Sales Order Subform -- OnInsertRecord
- Sales Line Table -- OnInsert
0 -
Hi FB,
You are awesome.
That did the trick. I wish we as Navision programmers could update our skills with tips and tricks like this. There are actually so many things we just don't know.
Thanks again!
Kind regards,
Roelof de Jong.Roelof de Jonghttp://www.wye.com0 -
-
ajhvdb,
Yes, it really works. What happens is that, if you set DelayedInsert = true, Navision is not immediateley inserting a new record when you enter data on a line. If you add some code to the OnInsert trigger of the form with an Exit(true) it will immediately save the line when you fire some code in that trigger. So, I was able to insert my subline, based on the key: DocType,DocNo,LineNo,SubLine.
I hope this helps.Roelof de Jonghttp://www.wye.com0
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