NAV 2009 RTC error on Record.GET function
oumaoliech
Member Posts: 3
Hi,
I did an upgrade for a client from NAV 5.0 to NAV 2009 SP1. The Classic Client works fine but the RTC doesn't. When posting purchase invoices it brings and error message "The primary key definition of the purchase line table has changed. start your activity again". On posting shipment for service order it gives the error "The primary key definition of the service line table has changed. start your activity again". I followed this second one (Service order) using visual studio debugger and found the exact point where it is thrown :- Codeunit 5988: FinalizeLines() function. The generated C# looks like this:
private void FinalizeLines()
{
.........
// IF ServLine.FIND('-') THEN
if(servLine.Target.ALFind(DataError.TrapError, @-))
{
// REPEAT
do
{
// IF PServLine.GET("Document Type","Document No.","Line No.") THEN BEGIN
if(pServLine.Target.ALGetSafe(DataError.TrapError, 462791, ( (NavOption)(servLine.Target.GetFieldValueSafe(1, NavType.Option)) ), ( (NavCode)(servLine.Target.GetFieldValueSafe(3, NavType.Code)) ), ALCompiler.ToNavValue(servLine.Target.GetFieldValueSafe(4, NavType.Integer).ToInt32())))
{
// PServLine.COPY(ServLine);
.......................
The commented lines are the original C/AL code
The error is caused by the line:
PServLine.GET("Document Type","Document No.","Line No.")
Does anyone have any idea why this would happen and why it only happens in RTC and not in classic client?
I did an upgrade for a client from NAV 5.0 to NAV 2009 SP1. The Classic Client works fine but the RTC doesn't. When posting purchase invoices it brings and error message "The primary key definition of the purchase line table has changed. start your activity again". On posting shipment for service order it gives the error "The primary key definition of the service line table has changed. start your activity again". I followed this second one (Service order) using visual studio debugger and found the exact point where it is thrown :- Codeunit 5988: FinalizeLines() function. The generated C# looks like this:
private void FinalizeLines()
{
.........
// IF ServLine.FIND('-') THEN
if(servLine.Target.ALFind(DataError.TrapError, @-))
{
// REPEAT
do
{
// IF PServLine.GET("Document Type","Document No.","Line No.") THEN BEGIN
if(pServLine.Target.ALGetSafe(DataError.TrapError, 462791, ( (NavOption)(servLine.Target.GetFieldValueSafe(1, NavType.Option)) ), ( (NavCode)(servLine.Target.GetFieldValueSafe(3, NavType.Code)) ), ALCompiler.ToNavValue(servLine.Target.GetFieldValueSafe(4, NavType.Integer).ToInt32())))
{
// PServLine.COPY(ServLine);
.......................
The commented lines are the original C/AL code
The error is caused by the line:
PServLine.GET("Document Type","Document No.","Line No.")
Does anyone have any idea why this would happen and why it only happens in RTC and not in classic client?
0
Comments
-
Thanks a lot deV.ch. Recompiling the object works. the error mysteriously goes away0
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
- 322 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