Editing Codeunit 1 — Dynamics NAV 2009 R2

You must add the appropriate Insight code changes to the codeunit design. Carefully editing codeunit 1 can preserve any changes that may have already been made to it.

The file COD1.txt resides in the NAS working directory subfolder that holds the Dynamics NAV localization, database version, and build, for example: ..\Microsoft Dynamics NAV\60\Application Server\ScribeModifications\W1.6.02.32012.

To edit the codeunit, use the .txt file that matches your version of Dynamics NAV. Dynamics NAV suggests that you review COD1.txt before editing codeunit 1.

To edit codeunit 1

  1. In Dynamics NAV, click Tools > Object Designer. The Object Designer appears.
  2. Click Codeunit (Codeunit Icon).
  3. From the list of codeunits, select the codeunit with the ID number 1, ApplicationManagement (at the top of the list).
  4. Click Design. The C/AL Editor appears.
  5. Click anywhere in the codeunit design open.
  6. In Microsoft Dynamics NAV, click View > C/AL Globals.
  1. On the Functions tab, select the GetGlobalTableTriggerMask global trigger function, then click Locals.
  2. On the Variables tab, verify that the global trigger function has an entry for ScribePublisher.

    Global trigger functions must have these local variables. If necessary, edit the functions to include the necessary variables.

    NameDataTypeSubtypeLength
    ScribePublisher Codeunit Scribe Publisher 
  3. On the Functions tab, select each of the following global trigger functions and repeat step 9 to add the needed variable on the Variables tab:
  4. Close the C/AL Globals window. This returns you to the C/AL Editor.
  5. Edit codeunit 1 ApplicationManagement to add the following lines to the NasHandler:
  6. When you are done, save the codeunit and make sure that it compiles without errors. Make a note of the codeunit's new revision level.

    Note: In the Object Designer, in the Version List column, edit the Release Sales Document codeunit's version to reflect the new revision level.

Next step

See also

Editing the codeunits — Dynamics NAV 2009 R2