Editing codeunit 1 — Dynamics NAV 2018

Insight codeunit modifications cause the Insight Adapter Hooks codeunit to run when NASHandler is called with parameter of 'SCRIBE'. This allows communication with Insight through the NAS. The trigger functions are also modified to publish inserts, modifies, and deletes to Insight.

Add the appropriate Insight code changes to the codeunit design. Carefully editing codeunit 1 can preserve any changes that 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\110\Service\Add-Ins\Scribe\W1.11.0.19394.

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

To edit codeunit 1

  1. Open the Microsoft Dynamics NAV Development Environment.
  2. Click Tools > Object Designer. The Object Designer appears.
  3. Click Codeunit (Codeunit Icon).
  1. From the list of codeunits, select codeunit 1, ApplicationManagement at the top of the list.
  2. Click Design to open the C/AL Editor.
  3. After it is open, click anywhere in the codeunit design.
  4. On the Microsoft Dynamics NAV 2018 Development Environment View menu, click C/AL Globals.
  5. On the Functions tab, select the GetDatabaseTableTriggerSetup global trigger function, then click Locals.
  6. On the Variables tab, create a ScribePublisher variable as noted below, then close this window.

    Global trigger functions must have these local variables.

    NameDataTypeSubtypeLength

    ScribePublisher

    Codeunit

    Scribe Publisher

     

  7. 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:
  8. On the Functions tab, create a new function titled NASHandler:
  9. Close the C/AL Globals window to return to the C/AL Editor.
  10. In codeunit 1 ApplicationManagement, edit the following global trigger functions:
  11. 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 ApplicationManagement codeunit's version to reflect the new revision level.

See also

Editing the codeunits — Dynamics NAV 2018

Next step