NAV 2009 RTC error on Record.GET function

oumaoliechoumaoliech Member Posts: 3
edited 2011-03-25 in NAV Three Tier

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, @-))





// 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?


  • Member Posts: 543
    I don't know why it happens, but have you tried to recompile the object?
  • oumaoliechoumaoliech Member Posts: 3
    Thanks a lot Recompiling the object works. the error mysteriously goes away
  • Member Posts: 543
    I recomend you to recompile all objects in the DB! I also suggest to do that after a change of build version! This prevents you from this kind of "strange" errors.
Sign In or Register to comment.