Single record tables

freddy.dk
Member, Microsoft Employee Posts: 360
Now it is my turn to ask a question to all the NAV experts here...
What is the preferred mechanism in NAV to limit a table to have only one record?
I can of course create a field, which always is 0 and set this to be the primary key - but is the best way?
What is the preferred mechanism in NAV to limit a table to have only one record?
I can of course create a field, which always is 0 and set this to be the primary key - but is the best way?
Freddy Kristiansen
Group Program Manager, Client
Microsoft Dynamics NAV
http://blogs.msdn.com/freddyk
The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.
Group Program Manager, Client
Microsoft Dynamics NAV
http://blogs.msdn.com/freddyk
The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.
0
Answers
-
The standard NAV approach is to handle it in the form. You can see this in the various setup forms. There is nothing that prevents you from adding multiple records to a setup table via Object Designer. I think it's debateable whether this is the best approach.
Form - OnOpenForm() RESET; IF NOT GET THEN INSERT;
There are no bugs - only undocumented features.0 -
[Topic moved from 'NAV 2009' forum to 'NAV/Navision' forum]Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
I believe a new property in the Table called MaxNoOfRecord.
The default would be 0 = unlimited and users can set it to 1.
through code you could add OnInsert trigger.
If not ISEMPTY then
Error('You cannot insert more than 1 record into the table');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