Editing codeunit 86 — Dynamics NAV 2009 R2

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

The file COD86.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. TIBCO suggests that you review COD86.txt before editing codeunit 86.

To edit codeunit 86

  1. In Dynamics NAV, open the Object Designer.

    Note: On the Tools menu, click Object Designer or press SHIFT + F12.

  2. In the Object Designer, click Codeunit (Codeunit Icon).
  3. From the list of codeunits, select the codeunit with the ID number 86, Sales-Quote to Order.
  4. Click Design. The C/AL Editor opens.
  5. Click anywhere in the OnRun section of the open codeunit.
  6. On the Dynamics NAVView menu, click C/AL Locals.
  1. Click the Variables tab, then add the following local variables:
    NameDataTypeSubtypeLength
    ScribePublisher CodeunitScribe Publisher 
    RecRefRecordRef  
  2. Close the C/AL Locals window. This returns you to the C/AL Editor.
  3. In the OnRun section:

    After:

    SalesOrderHeader.INSERT(TRUE);

    Add:

    // Trigger ScribePublisher
    RecRef.GETTABLE(SalesOrderHeader);
    ScribePublisher.PublishInsertion(RecRef);

    After:

    ToDocDim.DELETEALL;

    Add:

    // publish deletion of sales quote line
    RecRef.GETTABLE(SalesQuoteLine);
    ScribePublisher.PublishDeletion(RecRef);
    // publish insertion of sales order line
    RecRef.GETTABLE(SalesOrderLine);
    ScribePublisher.PublishInsertion(RecRef);

  4. 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 Sales-Quote to Order codeunit's version to reflect the new revision level.

Next step

See also

Editing the codeunits — Dynamics NAV 2009 R2