Search code examples
microsoft-dynamicsnavisiondynamics-nav

In Dynamics NAV, what are the variables text@digits in C/AL?


I am new to Dynamics Navision, I have not been able to find and answer via web search. In the following few line of C/AL code, could someone please tell me what do @10000000, @10002000, Text[512] and Codeunit 50000 mean? PS: I made up the numbers for demo purpose.

VAR 
  abc@10000000 : Text[512];
  def@10002000 : Codeunit 50000;

Solution

  • Abc is a variable of type text (same as string) with maximum length of 512 symbols

    Def is the variable of type Codeunit (same as module or class). It is more like an inatance of the class. 50000 is the unique number of the codeunit object, this is how Nav refers to object.

    Numbers after @ is internal thing of Nav. For some historical reason they liked to give a number to anything even if this is completely meaningless. Variables, constants, fields in tables, fields on pages, action, every last piece of trash will have a number. This number must be unique in its scope.

    Numbers of objects and fields are used in license to restrict editing of someone else's code.

    If you want to edit Nav object externally, then just give up or upgrade to newer versions. Starting with BC14 you can use vs code to write extension on a decent IDE.