how to use noseries???

suspect
Member Posts: 16
I have a custom table with a key field "number". I would like to have a automatic noseries in this field every time i create a new record, just like it is at sales header. So how could that be done?? :oops:
0
Comments
-
-
You have to define a field No. Series in the custom table like in Sales Header.
If you use Developers Toolkit, you could search for "Order Nos." (from Sales & Receivables Setup) and see where it's being used.
Modify the corresponding custom objects like the "Order Nos."-objects the Developers Toolkit has found.
Tino Ruijs
Microsoft Dynamics NAV specialist0 -
basically u need to
1) in some setup table "SetupTable" create a field for your number serie "Your Nos." which would have a relation to "No. Series" table
2) in your table (that you want to auto number records by no serie "Your Nos.") create a field "No. Series". This field will hold the value of no serie "Your Nos." that was used to generate a primary key value for the given record
3) write the following code in OnInsert trigger of your table (here i assume the primary key consists of one field named "No."):IF "No." = '' THEN BEGIN SetupTable.GET; SetupTable.TESTFIELD("Your Nos."); NoSeriesMgt.InitSeries( SetupTable."Your Nos.",xRec."No. Series",0D,"No.","No. Series"); END;
4) in your table's OnValidate trigger for the primary key field "No." write the following code (to allow manual code input along with automatic assignement from no serie):IF "No." <> xRec."No." THEN BEGIN SetupTable.GET; NoSeriesMgt.TestManual(SetupTable."Your Nos."); "No. Series" := ''; END;
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