Error: An attempt was made to change an old version of a “Sales Line” record

When posting e.g. a Warehouse Shipment or an other document concerning direct or indirect table “Sales Line”, then following error can occur:

An attempt was made to change an old version of a “Sales Line” record. The record should first be reread from the database. This is a programming error. Identification fields and values: …

Technical Detail:
This error occurs, when “Sales Line”.modify is called.

Reason:
The code was customized. Along the call chain the same “Sales Line” record is modified before the call, where the error occurs. That means there is a customized code (maybe in CU 80 or table “Sales Line”), where some fields are changed, then “Sales Line”.modify is called. After that “Sales Line”.modify is called a second time. That is not allowed.

Solution:
If you did not change the code by yourself, contact the colleague, who made the last changes or contact your NAV Partner. First challenge is to find the position, where “Sales Line”.modify is called first.
Hint: Debug the function, which causes the error and set a breakpoint into trigger OnModifyDatabase in CU 1. This trigger is called each time command modify is called.
When the position is found, change the code. If possible remove the first “Sales Line”.modify call.
Other solution: Reload the “Sales Line” record at the second position (where the error occurs) before calling modify with GET, then write the needed field changes, then call modiy.

cheers

Advertisements

Error: You do not have the following permissions on CodeUnit ApplicationManagement: Execute

If you get following error:

sc13

then your nav user account has to less rights to work with the RTC client. This kind of error is normally shown, when you start the RTC client.

Reasons for that error can be:

  • You work with a database which comes from outside of your windows domain
  • Your permission set was changed

To solve that issue best you open SSMS (Sql Server Management Studio) and view table “User”. Search for your windows/nav account in field “User Name”. To go further you need the value in field “User Security ID”. Remember that value.

sc15

Then edit table “Access Control” and look for the same value in field “User Security ID”.

sc142

Change the “Role ID” value to SUPER, click the ENTER key to assign the change.

After that restart the RTC client and change your user settings as needed.

Cheers

Error: Table 2000000009 has no name

If you get following error:

sc12

then the database is corrupted. In detail it means sql view “Session” is missing in the database! This can be a result of a crashed backup/restore process or a failed conversion process.

sc13

It can be, that View “Database File” is also missing. Although it is possible to restore the missing view e.g. from a (not changed) default cronus database, it won’t help, but you can give it a try. You can restore a new cronus database from the nav 2009 setup, subfolder SQLDemoDatabase\CommonAppData\Microsoft\Microsoft Dynamics NAV\60\Database.

In most cases it’s needed to restore the database from an earlier backup. If you do not have a backup strategy for your databases – but you should have – then export all changed nav objects as text files from the current, crashed database and start with a new database on base of a cronus database. then import/migrate the changed nav objects. after that re-compile all nav objects and restart the nav service.

Helpful Links:
http://saurav-nav.blogspot.co.at/2012/02/metadata-for-object-of-type-table-with.html

cheers

Error: Could not load the selected type library

This is a common error, which can be caused by following reasons:

  • an automation is missing
  • the automation was missing, then installed on the system, but the nav object was not re-compiled after installation
  • a different version of the automation is expected by the nav object.

If this error occurs, check where the variable is defined (local or global variables list). After you found the variable, you will see, that the value in field Subtype is like “Unknown Automation Server.Application”. When exporting the Nav object as text file, you would find a subtype value like that: Class1@1000000010 : Automation “{D1233675-2BBA-49DD-AD90-1680A404EAD5} 1.0:{DB3E185E-C123-46C2-9C62-F4A4E81E0B8F}:’FunnyAutomation’.Class1”. If you don’t know exactly what you are missing, this strange looking subtype value can help you for research.

sc6

Next step is – and that is the importand one – remove the value in field subtype! Do not click on the Assist button first and choose the automation without removing the value. It won’t work! So, first remove the value, then click on the Assist button and search for the missing automation.

If you do not find the missing automation, then look for the setup file and install the automation. After that restart the CC Client and start this fix procedure from the beginning. If you don’t know, which automation is missing (maybe an old code, a code of a different developer, …), then start with a research, ask your colleagues, your PM, do a little web search or find an alternative solution.

If all is fine, the automation is installed and the Unknown… value was removed, find and choose the automation after clicking on the Assist button and select the needed embedded class of the automation. After that re-compile the Nav Object and test the whole thing.

cheers

Error, when creating an instance of a .net class

Following error can occur, when creating an instance of a .net class in C/AL:

nav_error_1

Reasons:

  • If the assembly is used on client side (property RunOnClient=True), then the assembly was not copied to the local Add-ins Folder of the RTC Client. To copy the assembly into this folder you need in most cases Admin rights. So, check that first.
  • If the assembly is used on server side (property RunOnClient=False), then there might be a version conflict between the assembly file located in the Add-ins Folder of the Nav Service and the used version in the C/AL Code. That can easy occur after installing Updates. So update the code and restart the nav service.
  • Missing System permission: That means, that the assembly was copied from the web or from a computer outside the local network to a target computer/server with windows server OS. Then, the assembly is automatically blocked by the system.

You cannot create an Automation object ‘name of autom.’ on Microsoft Dynamics NAV Server. You must create it on a client computer.

This is an error message, when trying to create an instance of an automation on a nav server vs. >= 2013. It’s only possible to create the automation instance as client instance. Creating automation instances on nav server is allowed till nav 2009.

solution:
use create(<name_of_autom.>,false,true) instead of create(<name_of_autom.>).

remarks:
you need a installed version of the automation on each client computer.

links:
create fct.: http://msdn.microsoft.com/en-us/library/dd355255(v=nav.70).aspx
Usage of automations in nav 2013: http://msdn.microsoft.com/en-us/library/ee909565(v=nav.70).aspx
Usage of automations in nav 2009: http://msdn.microsoft.com/en-us/library/ee909565(v=nav.60).aspx