Get fails for table with RecordID as primary key

bmccarthy
Member Posts: 48
We have discovered a bug in NAV 4.2 or lower which is causing us serious problems. If you have a table that has 1 primary key of type RecordID and you add record ids that are numerical and also alpha numerical, then when you use the GET C/SIDE function it fails when you go from get for a numerical only ID to the alpha numerical ID in a loop. Any example of the data is below and is based on Customer table in the demo database of the NAV product.
I have a table with only one field of type RecordID. I take recordIDs for the Customer records in the record table and add them into my table. I then call GET(recorded) to retrieve an earlier stored record.
IF I only add record IDs where the key is numbers only its fine
RecordID GET result
Customer: 12344 OK
Customer: 12345 OK
IF I only add record IDs where the key is numbers and letters its fine
RecordID GET result
Customer: AB123 OK
Customer: IC123 OK
However, If I add a mixture it fails on the first call to the change in type as I loop through calling GET.
RecordID GET result
Customer: 12344 OK
Customer: IC123 FAIL
It is very easy to reproduce this using a simple table and report based on the customer table which adds records in the OnPreReport and GET in the OnAfterGetRecord. Running the report for all customers in the sample database causes the crash. I can email a .fob of this test to anyone who would like a look.
Anyone any ideas?
I have a table with only one field of type RecordID. I take recordIDs for the Customer records in the record table and add them into my table. I then call GET(recorded) to retrieve an earlier stored record.
IF I only add record IDs where the key is numbers only its fine
RecordID GET result
Customer: 12344 OK
Customer: 12345 OK
IF I only add record IDs where the key is numbers and letters its fine
RecordID GET result
Customer: AB123 OK
Customer: IC123 OK
However, If I add a mixture it fails on the first call to the change in type as I loop through calling GET.
RecordID GET result
Customer: 12344 OK
Customer: IC123 FAIL
It is very easy to reproduce this using a simple table and report based on the customer table which adds records in the OnPreReport and GET in the OnAfterGetRecord. Running the report for all customers in the sample database causes the crash. I can email a .fob of this test to anyone who would like a look.
Anyone any ideas?
0
Comments
-
Usually primary key fields are type code - it shouldn't matter if it starts with a letter or number.
Is this Sql or native or both that you've found this in.
Are you sure it's not your get code?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