0% found this document useful (0 votes)
173 views162 pages

Adapter For Dynamics NAV - Developer Guide 2/22/2018

AdapterDynamicsNAVDeveloperGuide

Uploaded by

Paul Gabriel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
173 views162 pages

Adapter For Dynamics NAV - Developer Guide 2/22/2018

AdapterDynamicsNAVDeveloperGuide

Uploaded by

Paul Gabriel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 162

Adapter For Dynamics NAV - Developer Guide

2/22/2018
Legal Information
Copyright © 1996-2018 Scribe Software Corporation. All rights reserved.

Complying with all applicable copyright laws is the responsibility of the user. No part of this
document may be reproduced or transmitted in any form or by any means, electronic or
mechanical, for any purpose, without the express written permission of Scribe Software
Corporation.

Scribe Adapter, Scribe Console, Scribe Insight, Scribe Integrate, Scribe Publisher, and
Scribe Workbench are all trademarks of Scribe Software Corporation. All other names
are recognized as trademarks, registered trademarks, service marks, or registered
service marks of their respective owners.

The names of companies, products, people, characters, or data mentioned herein are
fictitious and are in no way intended to represent any real individual, company,
product, or event, unless otherwise noted.

Scribe Software Corporation may have patents, patent applications, trademarks,


copyrights, or other intellectual property rights covering subject matter in this
document. Except as expressly provided in any written license agreement from Scribe
Software Corporation, the furnishing of this document does not give you any license to
these patents, trademarks, copyrights, or other intellectual property.

Scribe Software Corporation makes no representations or warranties with respect to


the adapter or the contents or use of this document, and disclaims any express or
implied merchantability or fitness for any specific purpose. Information in this
document is subject to change without notice. Scribe Software Corporation reserves the
right to revise this document or to change its contents at any time without obligation to
notify any individual or corporation about the changes.

Regardless of whether any remedy set forth herein fails of its essential purpose, in no
event will Scribe Software Corporation be liable to you for any special, consequential,
indirect or similar damages, including any lost profits or lost data arising out of the use
or inability to use the software or documentation, even if Scribe has been advised of the
possibility of such damages. Some states do not allow the limitation or exclusion of
liability for incidental or consequential damages so the above limitation or exclusion
may not apply to you.

Thursday, February 22, 2018

Dynamics NAV Adapter Version -2 -


3.1.1
Contents

Contents

Contents 3

Scribe Insight Overview 9

Dynamics NAV Adapter 11

Use Cases 12

Connecting To Dynamics NAV 13

Requirements 15

Limitations 15

Implementing The Adapter For Dynamics NAV 17

Installing The NAS Components 19

Adapter-Only Release 19

Extract The Package From The Downloads Page 19

Scribe Insight Release 20

Installing The MSI File 20

Supporting Multiple Organizations 20

Setting The NAS Instance Properties 22

Assigning Unique Port Numbers 24

Importing The Scribe .fobs 26

Importing The Scribe .fobs — Dynamics NAV 2009 R2 27

Scribe-modified .fob Files 27

Importing A .fob 28

Importing The Scribe .fobs — Dynamics NAV 2013 29

Scribe-modified .fob Files 29

Importing A .fob 29

Importing The Scribe .fobs — Dynamics NAV 2013 R2 30

Scribe-modified .fob Files 30

Dynamics NAV Adapter Version -3 -


3.1.1
Contents

Importing A .fob 30

Importing The Scribe .fobs — Dynamics NAV 2015 32

Scribe-modified .fob Files 32

Importing A .fob 32

Importing The Scribe .fobs — Dynamics NAV 2016 34

Scribe-modified .fob Files 34

Importing A .fob 34

Importing The Scribe .fobs — Dynamics NAV 2017 36

Scribe-modified .fob Files 36

Importing A .fob 36

Editing The Codeunits 38

Editing The Codeunits — NAV 2009 R2 39

Making The Scribe Changes 39

Editing Codeunit 1 — Dynamics NAV 2009 R2 40

Editing Codeunit 80 — Dynamics NAV 2009 R2 43

Correcting The Window Variable Error 43

Making Other Changes To Codeunit 80 44

Editing Codeunit 86 — Dynamics NAV 2009 R2 47

Editing Codeunit 414 — Dynamics NAV 2009 R2 49

Editing The Codeunits — Dynamics NAV 2013 52

Modified Codeunits 52

Unmodified Codeunits 52

Editing Codeunit 1 — Dynamics NAV 2013 53

Editing Codeunit 44 — Dynamics NAV 2013 56

Editing Codeunit 80 — Dynamics NAV 2013 57

Correcting The Window Variable Error 57

Dynamics NAV Adapter Version -4 -


3.1.1
Contents

Making Other Changes To Codeunit 80 58

Editing Codeunit 414 — Dynamics NAV 2013 61

Editing The Codeunits — Dynamics NAV 2013 R2 63

Making The Scribe Changes To A Modified Codeunit 63

Making The Scribe Changes To An Unmodified Codeunit 63

Editing Codeunit 1 — Dynamics NAV 2013 R2 64

Editing Codeunit 44 — Dynamics NAV 2013 R2 68

Editing Codeunit 80 — Dynamics NAV 2013 R2 69

Correcting The Window Variable Error 69

Making Other Changes To Codeunit 80 70

Editing Codeunit 414 — Dynamics NAV 2013 R2 73

Editing The Codeunits — Dynamics NAV 2015 75

Making The Scribe Changes To A Modified Codeunit 75

Making The Scribe Changes To An Unmodified Codeunit 75

Editing Codeunit 1 — Dynamics NAV 2015 76

Editing Codeunit 44 — Dynamics NAV 2015 80

Editing Codeunit 80 — Dynamics NAV 2015 81

Correcting The Window Variable Error 81

Making Other Changes To Codeunit 80 82

Editing Codeunit 414 — Dynamics NAV 2015 85

Editing The Codeunits — Dynamics NAV 2016 87

Making The Scribe Changes To A Modified Codeunit 87

Making The Scribe Changes To An Unmodified Codeunit 87

Editing Codeunit 1 — Dynamics NAV 2016 88

Editing Codeunit 80 — Dynamics NAV 2016 93

Correcting The Window Variable Error 93

Dynamics NAV Adapter Version -5 -


3.1.1
Contents

Making Other Changes To Codeunit 80 94

Editing Codeunit 414 — Dynamics NAV 2016 97

Editing The Codeunits — Dynamics NAV 2017 99

Making The Scribe Changes To A Modified Codeunit 99

Making The Scribe Changes To An Unmodified Codeunit 99

Editing Codeunit 1 — Dynamics NAV 2017 100

Editing Codeunit 80 — Dynamics NAV 2017 105

Correcting The Window Variable Error 105

Making Other Changes To Codeunit 80 106

Editing Codeunit 414 — Dynamics NAV 2017 108

Activating The Scribe Actions 111

Importing Default Validation Rules 112

Import Into Dynamics NAV 2013 Or Higher 112

Import Into Dynamics NAV 2009 R2 113

Field-Level Validation 114

Installing The Adapter For Dynamics NAV 117

Scribe Insight Release 117

Adapter-Only Release 118

Connecting To The Adapter 120

Configuring The Publisher 123

Setting The Publish As User 124

Setting Up The Publisher Process And Queues 125

Troubleshooting Schema Errors 127

Connecting Via The Query Publisher 129

Notes: 129

Query Condition Dialog Box 131

Dynamics NAV Adapter Version -6 -


3.1.1
Contents

Filtering Publisher Messages 132

Scribe Dynamics NAV Objects 133

Mapping Object Relationships 134

Mapping To Fixed Values 134

Scribe Dynamics NAV Objects — Dynamics NAV 2009 R2 135

Scribe Dynamics NAV Objects — Dynamics NAV 2013 138

Scribe Dynamics NAV Objects — Dynamics NAV 2013 R2 140

Scribe Dynamics NAV Objects — Dynamics NAV 2015 142

Scribe Dynamics NAV Objects — Dynamics NAV 2016 144

Scribe Dynamics NAV Objects — Dynamics NAV 2017 146

Custom Actions 148

Standard Actions 149

Developing Custom Actions 150

Custom Action Methods 151

GetInputParameters 151

ExecuteCustomAction 151

SetOutputParameters 151

ResetToDefaults 152

Creating Custom Actions 155

Foreign Language Version Of Dynamics NAV 156

Modifying The SCRIBE.KSYNC Tables 156

Example 156

Checking Your Adapter's Version Number 159

Backing Up Your Data 160

Pausing The Integration Components 160

Uninstalling The Adapter 161

Dynamics NAV Adapter Version -7 -


3.1.1
Contents

Remove The NAS Components 161

Multiple Organizations 161

Uninstall The Adapter 162

Remove The Scribe Codeunit Customizations 162

Remove The Scribe Component Registrations 162

Dynamics NAV Adapter Version -8 -


3.1.1
Scribe Insight Overview
Scribe Software provides data integration and migration software solutions to help people
within an organization share critical customer data and, to better focus – and take action –
on critical business events. Scribe Software’s unique approach with its configurable
integration software, can help your organization achieve enterprise-class integration.
Scribe Insight is comprised of the Scribe Workbench and Scribe Console, Scribe Adapters,
and Scribe Templates.

The core technologies used by every Scribe Software customer are:

l Scribe Workbench — A graphical environment used to create the mapping


documents, called Data Translation Specification (DTS) files. DTS files are created
in Scribe Workbench and contain all of your translation settings in a small, portable,
format. Key features include:
o Connections — Define and store your source and target connection
information in a secure format. Scribe supports connections to a wide range of
source and target data through its application adapters, including the Microsoft
Dynamics family of products, Salesforce.com, and SalesLogix. In addition,
Scribe supports connections to many other leading business applications
through standards-based methods such as ODBC, Web services, OLE DB, and
message queues.
o Data processing rules and logic — From Scribe Workbench, you can easily
provide the logic to cause DTS files to perform a number of tasks, including:
branching to different steps to update, insert, or stop processing data; setting
errors based on user defined criteria; updating or deleting source rows based
on defined criteria; using the last run date of a job to determine which records
have changed; and comparing source and target values to determine if records
need to be updated, inserted, or ignored.
o Field transformation using formulas — Add formulas to transform source
fields to appropriate target values. Use Scribe's rich function library to convert
case, calculate, parse, or concatenate fields, perform field substitutions, make
conditional changes, and perform many other tasks. Additionally, you can
create custom functions to use in-process COM DLLs.
o Reports and debugging tools — Use Scribe Workbench tools to debug and
optimize DTS files. Tools include tracing, execution logs, exception and conflict
reports, and debugging utilities. Use the interactive performance tips to
troubleshoot problems, evaluate a DTS run, and improve performance.
o Source queries — Filter data to be processed based on changes or user
defined criteria.
o Duplicate detection — Define exact or “fuzzy” matching to identify duplicates
using multiple fields with AND/OR logic.

Dynamics NAV Adapter Version -9 -


3.1.1
Scribe Insight Overview

l Console and Integration Server — The Scribe Console provides the tools to
manage and automate DTS files as well as perform other administrative tasks such
as managing security, adding Scribe Publishers, configuring message queues, and
error notification. In addition, the Scribe Console is the user interface to the
Integration Server which facilitates the exchange of data between two or more data
sources. Key features include:
o Automation — Precisely define events to trigger the integration from
scheduling a batch process, to establishing near real-time polling intervals, to
real-time processing of messages in a queue.
o Notification — System monitoring of business level events or integration
errors with configurable alerts via e-mail, page, or net send.
o Error and exception handling — Execution history of processes that
succeeded or failed including detailed error reporting.
o Data views — Editable views that can be displayed in chart or list format.
o Windows Services — The underlying Windows services monitor and detect
events, process messages, and raise alerts.
o Scribe Internal Database — Stores execution and error logging, persisted
integration settings, cross reference tables, and integration statistics.
l Scribe Adapters — Enable Scribe to communicate with a variety of datastores
including applications, databases, messages, and files. In addition, Scribe Software
provides adapters for a number of other products that support one-way migrations
to CRM and ERP applications.

Dynamics NAV Adapter Version - 10 -


3.1.1
Dynamics NAV Adapter

Dynamics NAV Adapter


Scribe adapters allow the Scribe Workbench and services to interface with other
applications. The Scribe Adapter for Dynamics NAV is a component that works with the
Microsoft Dynamics NAV API to expose its objects and properties in the Scribe Workbench
for mapping and transformation purposes. The adapter exposes virtually all of the objects
supported by the Microsoft Dynamics NAV API.

The Dynamics NAV Adapter Version 3.1.1 communicates with the Microsoft Dynamics NAV
using NAV Application Server (NAS)-based custom logic to insert, update, and delete data
according to the business rules defined in Microsoft NAV.

The adapter presents the Microsoft Dynamics NAV to the Scribe Workbench user interface,
allowing Workbench users to do data mapping and transformation.

Scribe installs a ScribeAdapterHooks.dll on the NAV application server. Scribe's Dynamics


NAV Code units reference this dll which is used to communicate with the Scribe Adapter to
perform query, create, update, and delete operations. See Connecting To Dynamics NAV
for additional information.

The adapter simplifies data exchange between Microsoft Dynamics NAV and external
applications by:

l Encapsulating the business rules of Dynamics NAV, replicating the logic that is
applied when you add or change records using the Microsoft Dynamics NAV user
interface.
l Supporting more than 900 Dynamics NAV data objects, including Customers and
Ship-to Addresses, Items and Item Variants, and Sales Orders.
l Supporting retrieving, inserting, updating, and deleting data in Dynamics NAV.
l Dynamically adjusting to Dynamics NAV customizations without requiring recoding
or recompiling.
l Supporting multiple companies.
In addition, some versions introduce new environments:

l Microsoft Dynamics NAV 2009 R2 — Includes Microsoft Dynamics NAV 2009 R2


Classic with Microsoft SQL Server, a feature that enables you to add, modify and
insert records as well as configure Dynamics NAV through the Object Designer.
l Dynamics NAV 2013 — Includes the Microsoft Dynamics NAV 2013 Development
Environment, which enables you to configure Dynamics NAV through the Object
Designer, but cannot be used to modify records. To add, modify, or insert records
directly, use the Dynamics NAV Client. With the Dynamics NAV 2013 release, when
you run any table from the Dynamics NAV Object Designer, that table opens in a
Dynamics NAV Client window.
For more information about these features, see the Microsoft Dynamics NAV online help.

Dynamics NAV Adapter Version - 11 -


3.1.1
Dynamics NAV Adapter

Use Cases
Use the Dynamics NAV Adapter to migrate or integrate data as follows:

l Integrate Sales Orders generated in a Sales system into Dynamics NAV.


l Integrate Customer data from Dynamics NAV into a Marketing Campaign
application.
l Move inventory information from a SQL database into Dynamics NAV.
l Update product lists in your Sales application based on the product lists in Dynamics
NAV.

Custom Dynamics NAV code for this Adapter is developed and tested on W1
region installations. Use with other regions will require modifications.

Dynamics NAV Adapter Version - 12 -


3.1.1
Connecting To Dynamics NAV

Connecting To Dynamics NAV


The Scribe Adapter for Dynamics NAV uses Microsoft Dynamics NAV technology such as the
NAV Application Server (NAS) to get data in to and out of Dynamics NAV. 

The Dynamics NAV Application Server (NAS) is the business layer for the Microsoft
Dynamics NAV application. The NAS service is used to query data from and insert data into
Dynamics NAV. Each Dynamics NAV company or organization must have its own NAS
instance.

When pushing data into and out of Dynamics NAV, the adapter uses a NAS. The NAS
performs the appropriate business logic prior to persisting to the database and allows the
maximum performance when querying for data.

You import the Common.fob, which creates the ScribePublisherSettings table, then you
modify the installed code units to enable them to update this table and communicate with
the Publisher.

In the Scribe Insight Console, you define a Publisher, which writes to the
ScribePublisherSettings table all entities, operations, such as insert, update, and delete,
and any filter values you specify. When an operation defined for your Publisher changes a
record, that record is updated in the ScribePublisherSettings table.

When the Scribe NAV Publisher runs, it polls the ScribePublisherSettings table for record
changes and, when changes are found, filters those changes against the criteria you
defined, retrieves changed records that meet those criteria, and writes those changes as
XML messages to the PubIn queue. From that queue, the Publisher sends those messages
to the ScribeIn queue.

Dynamics NAV Adapter Version - 13 -


3.1.1
Connecting To Dynamics NAV

Only the users that have the access to Dynamics NAV can connect through the
Scribe Adapter for Dynamics NAV. They can perform the actions according to
their permissions settings in Microsoft Dynamics NAV.

Dynamics NAV Adapter Version - 14 -


3.1.1
Requirements

Requirements
The ideal configuration has two or more servers, with at least one server running Microsoft
Dynamics NAV, and one server hosting your Scribe application.

The Scribe Adapter for Dynamics NAV requires:

l Scribe Insight Version 7.9.3 or later.


l One of the following Microsoft Dynamics NAV versions:
o 2009 R2
o 2013
o 2013 R2
o 2015
o 2016
o 2017
l Microsoft .NET version 4.5.
This version is required for all Dynamics NAV NAS installers.

If the system you are connecting to requires a TLS 1.2 connection, you
must install .NET 4.5.2 or later. Some Windows Operating Systems do
not support TLS 1.1 or 1.2. See this Microsoft Blog post for more
information: Support For SSL/TLS Protocols On Windows.

l One Dynamics NAV Application Server (NAS) instance for each company being
integrated.
Before proceeding with the adapter installation, be sure all the required components are
installed and working correctly.

Custom Dynamics NAV code for this Adapter is developed and tested on W1
region installations. Use with other regions will require modifications.

Before installing any Scribe software, always check the Scribe and Adapters
Downloads page for any new information about versions and compatibility.

Before upgrading your adapters, always check with Scribe to verify that the
newer version of the adapter is compatible with the version of the template
you are using.

Limitations
The Scribe Adapter for Microsoft Dynamics NAV has the following known limitations:

Dynamics NAV Adapter Version - 15 -


3.1.1
Requirements

l Virtual fields are not supported.


l Binary large objects (BLOBs) such as Word documents or graphics files are not
supported
l Unicode data is supported with the Adapter for Dynamics NAV 2013 and greater.

While Scribe Insight 7.5 and later supports Unicode data, Dynamics NAV
2009 R2 does not. Therefore, the Scribe Adapter for Dynamics NAV cannot
provide support for Unicode data with Dynamics NAV 2009 R2.

Dynamics NAV Adapter Version - 16 -


3.1.1
Implementing The Adapter For Dynamics NAV

Implementing The Adapter For


Dynamics NAV
Implement the Scribe Adapter for Microsoft Dynamics NAV by installing and testing the
adapter component. If you have not used the adapter before, Scribe recommends reading
the Scribe Insight Overview and Dynamics NAV Adapter sections.

Scribe strongly recommends reviewing the adapter's release notes. The release notes are
installed with the adapter, or you can download them from the Scribe Success Community.

To Implement The Adapter For Dynamics NAV

1. Review the requirements. See Requirements.


2. Install the Dynamics NAV NAS Components for each company. See Installing The
NAS Components.
3. Set the properties for each NAS instance to establish a connection between Dynamics
NAV and the Scribe adapter. See Setting The NAS Instance Properties.
4. If you have multiple companies and multiple NAS instances, assign unique port
numbers to each instance. See Assigning Unique Port Numbers.
5. Import the three Scribe .fobs for your version of Dynamics NAV, including: Common
.fob, Scribe Products And Prices .fob, and a precompiled .fob. The precompiled .fob
contains Scribe-specific modifications to some Dynamics NAV codeunits. If you have
modified codeunits for another project, do not import the precompiled .fob. Instead,
edit the codeunits manually as discussed in step 6.
l Dynamics NAV 2009 R2
l Dynamics NAV 2013
l Dynamics NAV 2013 R2
l Dynamics NAV 2015
l Dynamics NAV 2016
l Dynamics NAV 2017
6. If you cannot import the precompiled .fob because you have other modifications to
the Dynamics NAV codeunits, edit the codeunits manually for your version of
Dynamics NAV.
l Dynamics NAV 2009 R2
l Dynamics NAV 2013
l Dynamics NAV 2013 R2
l Dynamics NAV 2015
l Dynamics NAV 2016
l Dynamics NAV 2017
7. Custom information used as custom actions must be placed in Dynamics NAV tables
so that Scribe Insight can access information about codeunits and their properties.
See Activating The Scribe Actions.

Dynamics NAV Adapter Version - 17 -


3.1.1
Implementing The Adapter For Dynamics NAV

8. Validation rules allow Scribe to manage the business logic for entities that Scribe
requires. These rules are defined in the Scribe Validation Rules table in Dynamics
NAV and applied to the data that is received by Dynamics NAV. See Importing Default
Validation Rules.
9. Install the Adapter for Dynamics NAV. See Installing the Adapter for Dynamics NAV.
10. In Scribe Insight, set up your Adapter's Connections to Dynamics NAV. See
Connecting To The Adapter.
11. Configure the Scribe Publisher for Dynamics NAV to publish new and changed data to
the ScribeIn message queue as XML messages. These messages can be used as
source data for Scribe integration processes or forwarded to other non-Scribe
processes. The Publisher for Dynamics NAV is installed as part of the adapter
installation. See Configuring the Publisher.

Dynamics NAV Adapter Version - 18 -


3.1.1
Installing The NAS Components

Installing The NAS Components


Before you begin, use Microsoft Dynamics NAV Administration to add a NAS Service
instance for each Dynamics NAV company at your site.

Scribe strongly recommends that you review the latest release notes from the Scribe
Success Community before you install the NAS access components.

You must install the Scribe Adapter for Dynamics NAV NAS in the Dynamics NAV
NAS directory before using the Dynamics NAV adapter.

You must be a member of the local administrators group on the machine


where you install the Scribe Adapter for Dynamics NAV NAS Service.

The steps for retrieving the Dynamics NAV installation packages differ, depending on
whether this adapter is released in an adapter-only release, or as part of an Insight
release.

Adapter-Only Release
When the Dynamics NAV adapter is released separately from an Insight release, you must
manually download the adapter installation packages from the Scribe Insight and Adapter
Downloads page, then install the NAS components.

Extract The Package From The Downloads Page


1. On the Scribe and Adapters Downloads page, under Scribe Adapter for Dynamics
NAV, click Installer. The File Download dialog box opens.
2. Click Save. The ScribeAdapterForMicrosoftDynamicsNAV.exe file is saved to
your Downloads directory.
3. In the Downloads directory, click ScribeAdapterForMicrosoftDynamicsNAV.exe.
The self-extracting zip file opens and unzips the following installation packages:
l ScribeAdapterForMicrosoftDynamicsNAV.msi — Scribe Adapter for
Dynamics NAV Version 3.1.1. Install this package on your Insight server. See
Installing the Adapter for Dynamics NAV.
l Version-specific NAS installation packages include:
o ScribeAdapterForMicrosoftDynamicsNAV2009NAS.msi
o ScribeAdapterForMicrosoftDynamicsNAV2013NAS_Service.msi
o ScribeAdapterForMicrosoftDynamicsNAV2013_R2_NAS_Service.msi
o ScribeAdapterForMicrosoftDynamicsNAV2015NAS_Service.msi
o ScribeAdapterForMicrosoftDynamicsNAV2016NAS_Service.msi
o ScribeAdapterForMicrosoftDynamicsNAV2017NAS_Service.msi

Dynamics NAV Adapter Version - 19 -


3.1.1
Installing The NAS Components

Use only the msi file that matches your Dynamics NAV NAS
version.

The default location for these files to be extracted is


C:\ScribeAdapterForMicrosoftDynamicsNAV.

4. Follow the steps for Installing The MSI File.

Scribe Insight Release


When the Dynamics NAV Adapter is released as part of an Insight release, the Dynamics
NAV installation packages are installed in the Adapters directory during the Scribe Insight
installation process. The default installation directory is one of the following: 

..\ScribeInsight792_x64\Adapters

..\ScribeInsight792_x32\Adapters

See Installing The MSI File.

Installing The MSI File


1. Open the directory containing the msi installation packages.
l If you extracted the msi files from the
ScribeAdapterForMicrosoftDynamicsNAV.exe, the default directory is
C:\ScribeAdapterForMicrosoftDynamicsNAV.
l If you installed Scribe Insight open either ..\ScribeInsight792_
x64\Adapters or ..\ScribeInsight792_x32\Adapters.
2. Copy or move the version-specific msi installation package to the Dynamics NAV NAS
Service Server. For example, if your Dynamics NAV NAS Service instance is for
Dynamics NAV 2016, you would copy the
ScribeAdapterForMicrosoftDynamicsNAV2016NAS_Service.msi file.
3. On the Dynamics NAV NAS server, double-click the version-specific msi installation
package that you copied. The Adapter Installation wizard appears.
4. Follow the directions in the wizard.
5. Click Finish to exit the wizard.

Supporting Multiple Organizations


To support more than one Dynamics NAV company or organization, use the following steps
for each Dynamics NAV company or organization you are supporting. If you are only using
a single Dynamics NAV company or organization, you can skip this step.

Dynamics NAV Adapter Version - 20 -


3.1.1
Installing The NAS Components

1. Browse to the folder in which you installed the Dynamics NAV NAS Service instance.
2. Copy the following files and folders:
l Files:
o Microsoft.Dynamics.Nav.Types.dll
o Scribe.NavAdapter.NasHook.dll
o Scribe.NavAdapter.NasHook.tlb
o Scribe.NavAdapter.NasHook.XmlSerializers.dll
o ScribeNasSettings.xml
l Folders:
o \ScribeModifications
o \ReleaseNotes
3. Paste these files and folders into each additional NAS instance's folder.
4. If you are running multiple NAS instances on the same server, see Assigning Unique
Port Numbers.

Dynamics NAV Adapter Version - 21 -


3.1.1
Setting The NAS Instance Properties

Setting The NAS Instance Properties


After you download and install the NAS Services, you need to set the properties for each
NAS instance to establish a connection between Dynamics NAV and the Scribe adapter.

To Set The NAS Instance Properties

1. Do one of the following:


l From Dynamics NAV, open Microsoft Dynamics NAV Administration and
select the NAS instance whose properties you want to set.
l Open the Application Server Manager and select the NAS instance whose
properties you want to set.
2. On the General tab, verify that the settings are correct for this NAS instance.

Use the Database Name and Database Server specified when you
created the Dynamics NAV connection in Insight.

3. Enter the name of the Company for this instance in the Services Default Company
field.
4. Expand the NAS Services tab.
5. Click Edit to make changes to the information for this instance.
6. Enter the following information:
l Startup Argument — Enter SCRIBE. This argument is case-sensitive and must
be in all capitals, as shown.
l Startup Codeunit — Enter 1.
l Startup Method — Enter NASHandler. This argument is case-sensitive.
7. Click Save.

After saving, you are prompted to restart.

8. From the Microsoft Dynamics NAV instance tree, right-click the instance you want to
change and select Login Account. The Login Account page appears.
9. Verify the login account for this instance has the following settings:
l Service Account — User Account
l User Name, Domain and Password — The credentials for a valid user with
SUPER permissions to your NAV database.
10. Click the Microsoft Dynamics NAV root node.
11. Select the instance you want to restart from the middle pane.
12. In the Actions pane, click Restart.

Dynamics NAV Adapter Version - 22 -


3.1.1
Setting The NAS Instance Properties

13. If desired, open the application log and review the event properties:
a. Right-click My Computer and click Manage. The Computer Management dialog
box appears.
b. Browse to System Tools > Event Viewer > Application.
c. Double-click the event.
d. Review the event properties.
14. Repeat this procedure for each NAS instance you want to use with the adapter.

l If you have multiple companies and multiple NAS instances:


o Assign unique port numbers to each instance
l If you do not have multiple companies and multiple NAS instances — Import the
Scribe .fobs for your Dynamics NAV installation:
o Dynamics NAV 2009 R2
o Dynamics NAV 2013
o Dynamics NAV 2013 R2
o Dynamics NAV 2015
o Dynamics NAV 2016
o Dynamics NAV 2017

Dynamics NAV Adapter Version - 23 -


3.1.1
Assigning Unique Port Numbers

Assigning Unique Port Numbers


Scribe requires a unique port number for each NAS instance running on a single server. The
port number is used exclusively by the Scribe Dynamics NAV adapter as part of the
connection information. The port differs from the ports specified when you configure an
instance using the NAV Administration module.

Each NAV instance has its own set of Scribe tables. Modify the NAS Port Configuration table
to assign a unique port number to that instance. The NAS Port Configuration table should
only have a single entry with the appropriate port number. The default port number is
8085. Use this port number for your first NAS instance. Assign new port numbers, such as
8086 or 8087, to each additional NAS instance running on the same computer.

Skip this step and use the default port number if:

l You only have a single NAS instance.


l You have multiple NAS instances running on different servers where each computer
can use the same port number.

To Assign A New Port Number

1. If you are installing on Dynamics NAV and need to support more than one Dynamics
NAV company or organization, for each Dynamics NAV company or organization
you are supporting:
a. Browse to the folder in which you installed the Dynamics NAV NAS.
b. Copy the following files and folders:
l Files:
o Microsoft.Dynamics.Nav.Types.dll
o Scribe.NavAdapter.NasHook.dll
o Scribe.NavAdapter.NasHook.tlb
o Scribe.NavAdapter.NasHook.XmlSerializers.dll
o ScribeNasSettings.xml
l Folders:
o \ScribeModifications
o \ReleaseNotes
c. Paste these files and folders into each additional NAS instance's folder.
d. Edit ScribeNasSettings.xml to assign a unique port number to each company
or organization.
2. From the Microsoft Dynamics NAV Development Environment, open the Object
Designer for the company whose port number you want to configure.
3. Within the Object Designer, select Table, then select the NAS Port Configuration
table.
4. Click Run. The NAS Port Configuration table opens within the client.

Dynamics NAV Adapter Version - 24 -


3.1.1
Assigning Unique Port Numbers

5. Specify the new port number in the Port No. column of the first row in this table.

l The selected company uses the port number specified in the first
row of this table. If the first row is not defined the port number
defaults to 8085.
l Use unique port numbers to avoid port conflicts. Be aware that
additional port numbers may also have been assigned.

6. Click OK to save and close the NAS Port Configuration table.


7. Repeat each of these steps for each additional NAS instance.

When connecting to the Adapter, use the server name and port number in the
NAS Server field.

l Dynamics NAV 2009 R2


l Dynamics NAV 2013
l Dynamics NAV 2013 R2
l Dynamics NAV 2015
l Dynamics NAV 2016
l Dynamics NAV 2017

Dynamics NAV Adapter Version - 25 -


3.1.1
Importing The Scribe .fobs

Importing The Scribe .fobs


When installing or upgrading the Scribe Adapter for Dynamics NAV, determine which of the
following .fobs you need to import for each of your databases:

l Common — Imports codeunits for the publisher and target, and creates tables
necessary for publishing and validation.

You must always import the Common .fob.

l Scribe Products And Prices — Creates tables in Dynamics NAV to store


Dynamics NAV data in a format that allows the template to integrate the data with
Microsoft Dynamics CRM.
This fob is only required for template use. However, the Importing Default
Validation Rules procedure assumes the tables created by this fob exist. If you do
not plan to use the template, edit scribevalidationrules.txt referenced in that
procedure to remove references to the ScribeProducts and ScribePrices tables.

l Precompiled — Contains all of the Dynamics NAV codeunits that include Scribe
changes. Whether you import this .fob is determined by whether you have made
any non-Scribe modifications to the Dynamics NAV codeunits.
For information about importing the .fob files associated with your Dynamics
NAV installation, click the appropriate link below:

l Dynamics NAV 2009 R2


l Dynamics NAV 2013
l Dynamics NAV 2013 R2
l Dynamics NAV 2015
l Dynamics NAV 2016
l Dynamics NAV 2017

Dynamics NAV Adapter Version - 26 -


3.1.1
Importing The Scribe .fobs — Dynamics NAV 2009 R2

Importing The Scribe .fobs — Dynamics


NAV 2009 R2
Scribe-modified .fob Files
When installing or upgrading the Scribe Adapter for Dynamics NAV, determine which of the
following .fobs you need to import for each of your databases:

l Common.fob — Imports codeunits for the publisher and target, and creates tables
necessary for publishing and validation.

You must always import the Common.fob.

l ScribeProductsAndPrices.fob — Creates tables in Dynamics NAV that are used


by the template: ScribePriceLevels, ScribeProducts, ScribeSalesPrices. These tables
store Dynamics NAV data in a format that allows the template to integrate the data
with Microsoft Dynamics CRM.
This fob is only required for template use. However, the Importing Default
Validation Rules procedure, assumes that the tables created by this fob exist. If you
do not plan to use the template, edit the scribevalidationrules.txt mentioned in
the procedure to remove references to the ScribeProducts, and ScribePrices tables.

l W1.6.02.32012.fob —A precompiled .fob that contains all of the codeunits that


include Scribe changes. Determine whether to import this .fob:
o If the codeunit does not contain any non-Scribe changes and the database
version and build match those of the corresponding .fob file, you can import
this fob to update all of the codeunits that have Scribe modifications.
o If you have made non-Scribe changes to any of these codeunits, do not import
this .fob. You must manually edit the codeunit files as described in Editing the
codeunits.

If your site is currently running Dynamics NAV 2009 R2 and you are
upgrading the Scribe Adapter for Dynamics NAV from version 1.7 to
version 1.8, you only need to import the Common.fob after upgrading.

If you are either installing the Adapter for Dynamics NAV for the first
time, or upgrading from a version of the Adapter earlier than version
1.7 , you must import all of the .fobs listed above.

Dynamics NAV Adapter Version - 27 -


3.1.1
Importing The Scribe .fobs — Dynamics NAV 2009 R2

Importing A .fob
1. In Dynamics NAV, open the Object Designer.

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

2. With the Object Designer open, click File > Import.


3. Browse to the Dynamics NAV installation directory: ..\Microsoft Dynamics
NAV\60\ApplicationServer\ScribeModifications.

This is the default installation directory. Your files may have been saved
to a different directory.

4. Select the .fob file that you want to import and click Open.

Dynamics NAV Adapter Version - 28 -


3.1.1
Importing The Scribe .fobs — Dynamics NAV 2013

Importing The Scribe .fobs — Dynamics


NAV 2013
Scribe-modified .fob Files
When installing or upgrading the Scribe Adapter for Dynamics NAV, determine which of the
following .fobs you need to import for each of your databases:

l Common2013.fob — Imports codeunits for the publisher and target, and creates
tables necessary for publishing and validation.

You always need to import the Common2013.fob.

l ScribeProductsAndPrices2013.fob — Creates tables in Dynamics NAV that are


used by the template: ScribePriceLevels, ScribeProducts, ScribeSalesPrices. These
tables store NAV data in a format that allows the template to integrate the data with
Microsoft Dynamics CRM.
This fob is only required for template use. However, the Importing Default
Validation Rules procedure, assumes that the tables created by this fob exist. If you
do not plan to use the template, edit the scribevalidationrules.txt mentioned in
the procedure to remove references to the ScribeProducts, and ScribePrices tables.

l W1.7.00.33781.fob — A precompiled .fob that contains all of the codeunits that


include Scribe changes. Determine whether to import this .fob:
o If the codeunit does not contain any non-Scribe changes and the database
version and build match those of the corresponding .fob file, you can import
this fob to update all of the codeunits that have Scribe modifications.
o If you have made non-Scribe changes to any of these codeunits, do not import
this .fob. You must manually edit the codeunit files as described in Editing the
codeunits.

Importing A .fob
1. In Dynamics NAV, open the Dynamics NAV 2013 Development Environment:
2. With the Development Environment open, go to File Import.
3. Browse to the Dynamics NAV installation directory: ..\Microsoft Dynamics
NAV\7x\Service\Add-Ins\Scribe\ScribeModifications.

This is the default installation directory. Your files may have been saved
to a different directory.

4. Select the .fob file that you want to import and click Open.

Dynamics NAV Adapter Version - 29 -


3.1.1
Importing the Scribe .fobs — Dynamics NAV 2013 R2

Importing The Scribe .fobs — Dynamics


NAV 2013 R2
Scribe-modified .fob Files
When installing or upgrading the Scribe Adapter for Dynamics NAV, determine which of the
following .fobs you need to import for each of your databases:

l Common2013R2.fob — Imports codeunits for the publisher and target, and


creates tables necessary for publishing and validation.

You always need to import the Common2013R2.fob.

l ScribeProductsAndPrices2013.fob — Creates tables in Dynamics NAV that are


used by the template: ScribePriceLevels, ScribeProducts, ScribeSalesPrices. These
tables store Dynamics NAV data in a format that allows the template to integrate
the data with Microsoft Dynamics CRM.
This fob is only required for template use. However, the Importing Default
Validation Rules procedure, assumes that the tables created by this fob exist. If you
do not plan to use the template, edit the scribevalidationrules.txt mentioned in
the procedure to remove references to the ScribeProducts, and ScribePrices tables.

l W1.7.10.35473.fob — A precompiled .fob that contains all of the Dynamics NAV


codeunits that include Scribe changes. Determine whether to import this .fob:
o If the existing Dynamics NAV codeunit does not contain any non-Scribe
changes, and the database version and build match those of the corresponding
.fob file, you can import this fob to update all of the codeunits that have Scribe
modifications.
o Howevever, if you have made non-Scribe changes to any of these codeunits, do
not import this .fob. Instead, manually edit the codeunit files as described in
Editing the codeunits.

The W1 fob has been created from a Dynamics NAV W1 installation. If


you have any other type of installation, or have modified the included
code units, you must manually edit the fobs. Do not import the W1 fob
if you are running, for example, a North American installation of
Dynamics NAV.

Importing A .fob
1. In Dynamics NAV, open the appropriate Microsoft Dynamics NAV 2013 R2
Development Environment.
2. With the Development Environment open, go to File Import.

Dynamics NAV Adapter Version - 30 -


3.1.1
Importing the Scribe .fobs — Dynamics NAV 2013 R2

3. Browse to the Dynamics NAV installation directory: ..\Microsoft Dynamics


NAV\71\Service\Add-Ins\Scribe\ScribeModifications.
4. Choose the .fob file that you want to import and click Open.

Dynamics NAV Adapter Version - 31 -


3.1.1
Importing the Scribe .fobs — Dynamics NAV 2015

Importing The Scribe .fobs — Dynamics


NAV 2015
Scribe-modified .fob Files
When installing or upgrading the Scribe Adapter for Dynamics NAV, determine which of the
following .fobs you need to import for each of your databases:

l Common2015.fob — Imports codeunits for the publisher and target, and creates
tables necessary for publishing and validation.

You always need to import the Common2015.fob.

l ScribeProductsAndPrices2015.fob — Creates tables in Dynamics NAV that are


used by the template: ScribePriceLevels, ScribeProducts, ScribeSalesPrices. These
tables store Dynamics NAV data in a format that allows the template to integrate
the data with Microsoft Dynamics CRM.
This fob is only required for template use. However, the Importing Default
Validation Rules procedure, assumes that the tables created by this fob exist. If you
do not plan to use the template, edit the scribevalidationrules.txt mentioned in
the procedure to remove references to the ScribeProducts, and ScribePrices tables.

l W1.8.0.37874.fob — A precompiled .fob that contains all of the Dynamics NAV


codeunits that include Scribe changes. Determine whether to import this .fob:
o If the existing Dynamics NAV codeunit does not contain any non-Scribe
changes, and the database version and build match those of the corresponding
.fob file, you can import this fob to update all of the codeunits that have Scribe
modifications.
o Howevever, if you have made non-Scribe changes to any of these codeunits, do
not import this .fob. Instead, manually edit the codeunit files as described in
Editing the codeunits.

The W1 fob has been created from a Dynamics NAV W1 installation. If


you have any other type of installation, or have modified the included
code units, you must manually edit the fobs. Do not import the W1 fob
if you are running, for example, a North American installation of
Dynamics NAV.

Importing A .fob
1. In Dynamics NAV, open the appropriate Microsoft Dynamics NAV 2015 Development
Environment.
2. With the Development Environment open, go to File Import.

Dynamics NAV Adapter Version - 32 -


3.1.1
Importing the Scribe .fobs — Dynamics NAV 2015

3. Browse to the Dynamics NAV installation directory: ..\Microsoft Dynamics


NAV\80\Service\Add-Ins\Scribe\ScribeModifications.
4. Choose the .fob file that you want to import and click Open.

Dynamics NAV Adapter Version - 33 -


3.1.1
Importing the Scribe .fobs — Dynamics NAV 2016

Importing The Scribe .fobs — Dynamics


NAV 2016
Scribe-modified .fob Files
When installing or upgrading the Scribe Adapter for Dynamics NAV, determine which of the
following .fobs you need to import for each of your databases:

l Common2016.fob — Imports codeunits for the publisher and target, and creates
tables necessary for publishing and validation.

You always need to import the Common2016.fob.

l ScribeProductsAndPrices2016.fob — Creates tables in Dynamics NAV that are


used by the template: ScribePriceLevels, ScribeProducts, ScribeSalesPrices. These
tables store NAV data in a format that allows the template to integrate the data with
Microsoft Dynamics CRM.
This fob is only required for template use. However, the Importing Default
Validation Rules procedure, assumes that the tables created by this fob exist. If you
do not plan to use the template, edit the scribevalidationrules.txt mentioned in
the procedure to remove references to the ScribeProducts, and ScribePrices tables.

l W1.9.00.42815.fob — A precompiled .fob that contains all of the Dynamics NAV


codeunits that include Scribe changes. Determine whether to import this .fob:
o If the existing Dynamics NAV codeunit does not contain any non-Scribe
changes, and the database version and build match those of the corresponding
.fob file, you can import this fob to update all of the codeunits that have Scribe
modifications.
o Howevever, if you have made non-Scribe changes to any of these codeunits, do
not import this .fob. Instead, manually edit the codeunit files as described in
Editing the codeunits.

The W1 fob has been created from a Dynamics NAV W1 installation. If


you have any other type of installation, or have modified the included
code units, you must manually edit the fobs. Do not import the W1 fob
if you are running, for example, a North American installation of
Dynamics NAV.

Importing A .fob
1. In Dynamics NAV, open the appropriate Microsoft Dynamics NAV 2016 Development
Environment.
2. With the Development Environment open, go to File Import.

Dynamics NAV Adapter Version - 34 -


3.1.1
Importing the Scribe .fobs — Dynamics NAV 2016

3. Browse to the Dynamics NAV installation directory: ..\Microsoft Dynamics


NAV\90\Service\Add-Ins\Scribe\ScribeModifications.
4. Choose the .fob file that you want to import and click Open.

Dynamics NAV Adapter Version - 35 -


3.1.1
Importing the Scribe .fobs — Dynamics NAV 2017

Importing The Scribe .fobs — Dynamics


NAV 2017
Scribe-modified .fob Files
When installing or upgrading the Scribe Adapter for Dynamics NAV, determine which of the
following .fobs you need to import for each of your databases:

l Common2017.fob — Imports codeunits for the publisher and target, and creates
tables necessary for publishing and validation.

You always need to import the Common2017.fob.

l ScribeProductsAndPrices2017.fob — Creates tables in Dynamics NAV that are


used by the template: ScribePriceLevels, ScribeProducts, ScribeSalesPrices. These
tables store Dynamics NAV data in a format that allows the template to integrate
the data with Microsoft Dynamics CRM.
This fob is only required for template use. However, the Importing Default
Validation Rules procedure, assumes that the tables created by this fob exist. If you
do not plan to use the template, edit the scribevalidationrules.txt mentioned in
the procedure to remove references to the ScribeProducts, and ScribePrices tables.

l W1.10.0.13682.fob — A precompiled .fob that contains all of the Dynamics NAV


codeunits that include Scribe changes. Determine whether to import this .fob:
o If the existing Dynamics NAV codeunit does not contain any non-Scribe
changes, and the database version and build match those of the corresponding
.fob file, you can import this fob to update all of the codeunits that have Scribe
modifications.
o Howevever, if you have made non-Scribe changes to any of these codeunits, do
not import this .fob. Instead, manually edit the codeunit files as described in
Editing the codeunits.

The W1 fob has been created from a Dynamics NAV W1 installation. If


you have any other type of installation, or have modified the included
code units, you must manually edit the fobs. Do not import the W1 fob
if you are running, for example, a North American installation of
Dynamics NAV.

Importing A .fob
1. In Dynamics NAV, open the appropriate Microsoft Dynamics NAV 2017 Development
Environment.
2. With the Development Environment open, go to File Import.

Dynamics NAV Adapter Version - 36 -


3.1.1
Importing the Scribe .fobs — Dynamics NAV 2017

3. Browse to the Dynamics NAV installation directory: ..\Microsoft Dynamics


NAV\100\Service\Add-Ins\Scribe\ScribeModifications.
4. Choose the .fob file that you want to import and click Open.

Dynamics NAV Adapter Version - 37 -


3.1.1
Editing The Codeunits

Editing The Codeunits


For Dynamics NAV to work with Scribe Insight, you must modify the codeunits for each
targeted database to:

l Provide the entry point for Scribe’s NAS-based custom logic


l Allow Scribe to publish updates, inserts, and deletes from the database
The steps to add the Scribe changes to the codeunits vary depending on whether your
codeunits have been modified.

If the codeunits have been modified, or if you do not know whether they have
been modified, Scribe suggests manually editing each codeunit file, as
described below, to preserve any previous changes.

l Modified Codeunits — If the codeunit has been modified, edit the codeunit to add
the Scribe code changes while preserving any modifications that have already been
made to codeunit.

Your Dynamics NAV license must have appropriate permissions to


open the C/AL editor. For information, see your Dynamics NAV
Administrator.

l Unmodified Codeunits — If you are sure that the codeunit does not contain any
non-Scribe modifications and you are running a Dynamics NAV W1 system, you can
import the precompiled .fob to update all of the codeunits with Scribe modifications.
These codeunits replace the standard codeunits but contain a number of Scribe-
specific changes.

Dynamics NAV Adapter Version - 38 -


3.1.1
Editing the codeunits — NAV 2009 R2

Editing The Codeunits — NAV 2009 R2


For Dynamics NAV to work with Scribe Insight, you must modify the codeunits for each
targeted database to:

l Provide the entry point for Scribe’s NAS-based custom logic


l Allow Scribe to publish updates, inserts, and deletes from the database
The steps to add the Scribe changes to the codeunits vary depending on whether your
codeunits have been modified.

If the codeunits have been modified, or if you do not know whether they have
been modified, Scribe suggests manually editing each codeunit file, as
described below, to preserve any previous changes.

Making The Scribe Changes

Working with codeunits requires an advanced level of Microsoft Dynamics


NAV system knowledge. Do not attempt to modify the codeunits unless you
are comfortable reading and editing Microsoft Dynamics NAV codeunits.

To Add Scribe Changes To A Modified Codeunit

If the codeunit has been modified, edit the codeunit to add the Scribe code changes while
preserving any modifications that have already been made to codeunit.

Your Dynamics NAV license must have appropriate permissions to open the


C/AL editor. For information, see your Dynamics NAV Administrator.

To Add Scribe Changes To An Unmodified Codeunit

If you are sure that the codeunit does not contain any non-Scribe modifications, you can
import the W1.6.02.32012.fob (as described in Importing the Scribe fobs) to update all of
the codeunits with Scribe modifications. These codeunits replace the standard codeunits but
contain a number of Scribe-specific changes.

Dynamics NAV Adapter Version - 39 -


3.1.1
Editing codeunit 1 — Dynamics NAV 2009 R2

Editing Codeunit 1 — Dynamics NAV


2009 R2
If codeunit 1 has been modified, you must add the appropriate Scribe 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\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 ( ).
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.
7. On the Functions tab, select the GetGlobalTableTriggerMask global trigger
function, then click Locals.
8. 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.

Name DataType Subtype Length


ScribePublisher Codeunit Scribe Publisher

9. 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:
l OnGlobalInsert
l OnGlobalModify
l OnGlobalDelete
l OnGlobalRename
10. Close the C/AL Globals window. This returns you to the C/AL Editor.
11. Edit codeunit 1 ApplicationManagement to add the following lines to the
NasHandler:

Dynamics NAV Adapter Version - 40 -


3.1.1
Editing codeunit 1 — Dynamics NAV 2009 R2

l At the start of the CASE statement, near the end of the function, add:
'SCRIBE':
CODEUNIT.RUN(CODEUNIT:: "Scribe Adapter Hooks");

l Edit each of the following global trigger functions to include the following code:
o Trigger Function 1
GetGlobalTableTriggerMask(TableID : Integer) : Integer

Add:

EXIT(ScribePublisher.GetTableTriggerMask
(ChangeLogMgt.GetTableTriggerMask(TableID),
TableID));

o Trigger Function 2
OnGlobalInsert(RecRef : RecordRef)

Add:

ChangLogMgt.LogInsertion(RecRef);
ScribePublisher.PublishInsertion(RecRef);

o Trigger Function 3
OnGlobalModify(RecRef : RecordRef;xRecRef : RecordRef)

Add:

ChangLogMgt.LogModification(RecRef,xRecRef);
ScribePublisher.PublishModification(RecRef,xRecRef);

o Trigger Function 4
OnGlobalDelete(RecRef : RecordRef)

Add:

ChangLogMgt.LogDeletion(RecRef);
ScribePublisher.PublishDeletion(RecRef);

o Trigger Function 5
OnGlobalRename(RecRef : RecordRef;xRecRef : RecordRef)

Add:

ChangLogMgt.LogRename(RecRef,xRecRef);
ScribePublisher.PublishRename(RecRef,xRecRef);

12. 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.

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

Dynamics NAV Adapter Version - 41 -


3.1.1
Editing codeunit 1 — Dynamics NAV 2009 R2

Dynamics NAV Adapter Version - 42 -


3.1.1
Editing codeunit 80 — Dynamics NAV 2009 R2

Editing Codeunit 80 — Dynamics NAV


2009 R2
If codeunit 80 has been modified, you must add the appropriate Scribe code changes to the
codeunit design. Carefully editing codeunit 80 can preserve any changes that have already
been made to it.

The file COD80.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. Scribe
suggests that you review COD80.txt before editing codeunit 80.

Correcting The Window Variable Error

When running the PostSalesOrder custom action which wraps Codeunit 80


Sales-Post, you may get an error message saying that you cannot use C/AL
variables of type DIALOG when running the Application Server. This error is
caused by the global variable Window used in OnRun trigger.

To Correct The Window Variable Error

Dynamics NAV C/AL code requires BEGIN and END keywords encapsulating
compound statements. Where the “IF GUIALLOWED THEN:” statement is
added, if there are multiple lines of C/AL Code invoking the Window variable,
then the BEGIN and END keywords must be used to encapsulate all of lines of
code.

Add the following statement before all instances of the Window variable in the design
of codeunit 80:
IF GUIALLOWED THEN

For example, for the following statement:

Window.UPDATE(1,STRSUBSTNO(Text007,"Document
type","No.",SalesInvHeader."No."));

Add:

IF GUIALLOWED THEN
Window.UPDATE(1,STRSUBSTNO(Text007,"Document
type","No.",SalesInvHeader."No."));

This eliminates the error message when the NAS runs codeunit 80.

Dynamics NAV Adapter Version - 43 -


3.1.1
Editing codeunit 80 — Dynamics NAV 2009 R2

Making Other Changes To Codeunit 80


After you correct the Window variable error, make the remaining required edits to codeunit
80.

To Edit Codeunit 80

1. In Dynamics NAV, click Tools > Object Designer. The Object Designer appears.
2. In the Object Designer, click Codeunit ( ).
3. From the list of codeunits, select the codeunit with the ID number 80, Sales-Post.
4. Click Design. The C/AL Editor appears.
5. Click anywhere in the OnRun section of the open codeunit.
6. In Dynamics NAV, click View > C/AL Locals.
7. Click the Variables tab, then add the following local variables:

Name DataType Subtype Length


ScribePublisher Codeunit Scribe Publisher
RecRef RecordRef

8. Close the C/AL Locals window. This returns you to the C/AL Editor.
9. Click View > C/AL Globals. On the Variables tab, add the global variable:

Name DataType Subtype Length


CustLedgEntry Record Cust. Ledger Entry

10. Save and close C/AL Globals, to return to the C/AL Editor.
11. In the OnRun section:
After:

SalesInvHeader.INSERT;

Add:

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

After:

IF "Bal. Account No." <> '' THEN BEGIN:

Replace:

Window.UPDATE(5,1);
IF NOT IsOnlinePayment(SalesHeader) THEN
PostBalancing(TempJnlLineDim,0)

With:

Dynamics NAV Adapter Version - 44 -


3.1.1
Editing codeunit 80 — Dynamics NAV 2009 R2

//*****SCRIBE BEGINS*****
//Hide GUI window in NAS
IF GUIALLOWED THEN
Window.UPDATE(5,1);
//*****SCRIBE ENDS*****

CustLedgEntry.FINDLAST;
GenJnlLine.INIT;
GenJnlLine."Posting Date" := "Posting Date";
GenJnlLine."Document Date" := "Document Date";
GenJnlLine.Description := "Posting Description";
GenJnlLine."Shortcut Dimension 1 CodeLeft" := "Shortcut Dimension 1
CodeLeft";
GenJnlLine."Shortcut Dimension 2 CodeLeft" := "Shortcut Dimension 2
CodeLeft";
GenJnlLine."Reason CodeLeft" := "Reason CodeLeft";
GenJnlLine."Account Type" := GenJnlLine."Account Type"::Customer;
GenJnlLine."Account No." := "Bill-to Customer No.";

IF "Document Type" = "Document Type"::"Credit Memo" THEN


GenJnlLine."Document Type" := GenJnlLine."Document Type"::Refund  
ELSE
GenJnlLine."Document Type" := GenJnlLine."Document Type"::Payment;
GenJnlLine."Document No." := GenJnlLineDocNo;
GenJnlLine."External Document No." := GenJnlLineExtDocNo;

IF "Bal. Account Type" = "Bal. Account Type"::"Bank Account" THEN


GenJnlLine."Bal. Account Type" := GenJnlLine."Bal. Account Type"::"Bank
Account";  
GenJnlLine."Bal. Account No." := "Bal. Account No.";
GenJnlLine."Currency CodeLeft" := "Currency CodeLeft";
GenJnlLine.Amount :=
TotalSalesLine."Amount Including VAT" + CustLedgEntry."Remaining Pmt. Disc.
Possible";  
GenJnlLine."Source Currency CodeLeft" := "Currency CodeLeft";
GenJnlLine."Source Currency Amount" := GenJnlLine.Amount;
GenJnlLine.Correction := Correction;
CustLedgEntry.CALCFIELDS(Amount);

IF CustLedgEntry.Amount = 0 THEN
GenJnlLine."Amount (LCY)" := TotalSalesLineLCY."Amount Including VAT"  
ELSE
GenJnlLine."Amount (LCY)" :=  
TotalSalesLineLCY."Amount Including VAT" + 
ROUND(  
CustLedgEntry."Remaining Pmt. Disc. Possible" /  
CustLedgEntry."Adjusted Currency Factor");  

IF SalesHeader."Currency CodeLeft" = '' THEN


GenJnlLine."Currency Factor" := 1  
ELSE
GenJnlLine."Currency Factor" := SalesHeader."Currency Factor";   
GenJnlLine."Applies-to Doc. Type" := GenJnlLineDocType;
GenJnlLine."Applies-to Doc. No." := GenJnlLineDocNo;

Dynamics NAV Adapter Version - 45 -


3.1.1
Editing codeunit 80 — Dynamics NAV 2009 R2

GenJnlLine."Source Type" := GenJnlLine."Source Type"::Customer;


GenJnlLine."Source No." := "Bill-to Customer No.";
GenJnlLine."Source CodeLeft" := SrcCode;
GenJnlLine."Posting No. Series" := "Posting No. Series";
GenJnlLine."IC Partner CodeLeft" := "Sell-to IC Partner CodeLeft";
GenJnlLine."Allow Zero-Amount Posting" := TRUE;
GenJnlPostLine.RunWithCheck(GenJnlLine,TempJnlLineDim);

12. 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.

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

Dynamics NAV Adapter Version - 46 -


3.1.1
Editing codeunit 86 — Dynamics NAV 2009 R2

Editing Codeunit 86 — Dynamics NAV


2009 R2
If codeunit 86 has been modified, you must add the appropriate Scribe code changes to the
codeunit design. Carefully editing codeunit 86 can preserve any changes that 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. Scribe
suggests that you review COD86.txt before editing codeunit 86.

To Edit Codeunit 86

1. In Dynamics NAV, open the Object Designer.

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

2. In the Object Designer, click Codeunit ( ).


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 NAV View menu, click C/AL Locals.
7. Click the Variables tab, then add the following local variables:

Name DataType Subtype Length


ScribePublisher Codeunit Scribe Publisher
RecRef RecordRef

8. Close the C/AL Locals window. This returns you to the C/AL Editor.
9. In the OnRun section:
After:

SalesOrderHeader.INSERT(TRUE);

Add:

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

After:

Dynamics NAV Adapter Version - 47 -


3.1.1
Editing codeunit 86 — Dynamics NAV 2009 R2

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);

l In IF SalesQuoteLine.FINDSET THEN:
After:

DocDim.MoveDocDimToDocDim(
FromDocDim,
DATABASE::"Sales Line",
SalesOrderHeader."No.",
SalesOrderHeader."Document Type",
SalesOrderLine."Line No.");

Add:

//*****SCRIBE BEGINS*****
// publish deletion of sales quote line
RecRef.GETTABLE(SalesQuoteLine);

cribePublisher.PublishDeletion(RecRef);
// publish insertion of sales order line
RecRef.GETTABLE(SalesOrderLine);
ScribePublisher.PublishInsertion(RecRef);
//*****SCRIBE ENDS*****

l Right before the SalesQuoteLine.DELETEALL;:


Add:

// publish deletion of sales quote header


RecRef.GETTABLE(Rec);
ScribePublisher.PublishDeletion(RecRef);

10. 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.

In the Object Designer, in the Version List column, edit the Sales-
Quote to Order codeunit's version to reflect the new revision level.

Dynamics NAV Adapter Version - 48 -


3.1.1
Editing codeunit 414 — Dynamics NAV 2009 R2

Editing Codeunit 414 — Dynamics NAV


2009 R2
If codeunit 414 has been modified, you must add the appropriate Scribe code changes to
the codeunit design. Carefully editing codeunit 1 can preserve any changes that have
already been made to it.

The file COD414.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 Microsoft Dynamics NAV.
Scribe suggests that you review COD414.txt before editing codeunit 414.

To Edit Codeunit 414

1. In Microsoft Dynamics NAV, click Tools > Object Designer. The Object Designer
appears.
2. Click Codeunit ( ).
3. From the list of codeunits, select the codeunit with the ID number 414, Release
Sales Document.
4. Click Design. The C/AL Editor appears.
5. Click anywhere in the OnRun section of the open codeunit.
6. In Microsoft Dynamics NAV, click View > C/AL Locals.
7. Click the Variables tab, then add the following local variables:

Name DataType Subtype Length


ScribePublisher Codeunit Scribe Publisher
RecRef RecordRef
xRecRef RecordRef

8. Close the C/AL Locals window. You return to the C/AL Editor.
9. In the OnRun section, after the statement IF Status = Status::Released THEN
EXIT; add the following:
// Get RecordRef of original record
xRecRef.GETTABLE(Rec);

10. At the end of the OnRun section, add the following:


// Trigger ScribePublisher
RecRef.GETTABLE(Rec);
ScribePublisher.PublishModification(RecRef,xRecRef);

11. In the C/AL Editor, click the Reopen section of the codeunit, then open the C/AL
Locals window. Click the Variables tab, then add the following variables:

Dynamics NAV Adapter Version - 49 -


3.1.1
Editing codeunit 414 — Dynamics NAV 2009 R2

Name DataType Subtype Length


ScribePublisher Codeunit Scribe Publisher
RecRef RecordRef
xRecRef RecordRef
LineRecRef RecordRef
xLineRecRef RecordRef

12. In the Reopen section:


After:

IF Status = Status::Open THEN EXIT

Add:

//Get RecordRef of original record


xRecRef.GETTABLE(SalesHeader);

In the WITH SalesHeader statement, before:

END;

Add:

//Trigger ScribePublisher
RecRef.GETTABLE(SalesHeader);
ScribePublisher.PublishModification(RecRef,xRecRef);

After:

IF SalesLine.FINDSET THEN REPEAT

Add :

//Get RecordRef of original record


xLineRecRef.GETTABLE(SalesLine);

Before the corresponding:

UNTIL SalesLine.NEXT = 0

Add:

//Trigger ScribePublisher
LineRecRef.GETTABLE(SalesLine);
ScribePublisher.PublishModification(LineRecRef,xLineRecRef);

13. 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.

Dynamics NAV Adapter Version - 50 -


3.1.1
Editing codeunit 414 — Dynamics NAV 2009 R2

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

Dynamics NAV Adapter Version - 51 -


3.1.1
Editing the codeunits — Dynamics NAV 2013

Editing The Codeunits — Dynamics NAV


2013
For Dynamics NAV to work with Scribe Insight, you must modify the codeunits for each
targeted database to:

l Provide the entry point for Scribe’s NAS-based custom logic


l Allow Scribe to publish updates, inserts, and deletes from the database
The steps to add the Scribe changes to the codeunits vary depending on whether your
codeunits have been modified.

If the codeunits have been modified, or if you do not know whether they have
been modified, Scribe suggests manually editing each codeunit file, as
described below, to preserve any previous changes.

Modified Codeunits
If the codeunit has been modified, edit the codeunit to add the Scribe code changes while
preserving any modifications that have already been made to codeunit.

Your Dynamics NAV license must have appropriate permissions to open the


C/AL editor. For information, see your Dynamics NAV Administrator.

No changes are required for codeunit 86 for adapters for Dynamics NAV 2013
and Dynamics NAV 2013 R2.

Unmodified Codeunits
If you are sure that the codeunit does not contain any non-Scribe modifications, you can
import the W1.7.00.33781.fob to update all of the codeunits with Scribe modifications.
These codeunits replace the standard codeunits but contain a number of Scribe-specific
changes.

Dynamics NAV Adapter Version - 52 -


3.1.1
Editing codeunit 1 — Dynamics NAV 2013

Editing Codeunit 1 — Dynamics NAV


2013
If codeunit 1 has been modified, you must add the appropriate Scribe 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\70\Service\Add-Ins\Scribe\ScribeModifications\W1.7.00.33781.

To edit the codeunit, use the .txt file that matches your version of Dynamics NAV. Scribe
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 ( ).
4. From the list of codeunits, select codeunit 1, ApplicationManagement at the top of
the list.
5. Click Design. The C/AL Editor appears.
6. After it is open, click anywhere in the codeunit design.
7. In the Microsoft Dynamics NAV 2013 Development Environment, click View > C/AL
Globals.
8. On the Functions tab, select the GetDatabaseTableTriggerSetup global trigger
function, then click Locals.
9. On the Variables tab, create a ScribePublisher variable as noted below, then close
this window.
Global trigger functions must have these local variables.

Name DataType Subtype Length


Scribe
ScribePublisher Codeunit Publisher

10. 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:
l OnDatabaseInsert
l OnDatabaseModify
l OnDatabaseDelete
l OnDatabaseRename
11. Close the C/AL Globals window. You return to the C/AL Editor.

Dynamics NAV Adapter Version - 53 -


3.1.1
Editing codeunit 1 — Dynamics NAV 2013

12. In codeunit 1 ApplicationManagement, edit the following global trigger functions:


l Trigger Function 1
GetDatabaseTableTriggerSetup(TableID: Integer; VAR OnDatabaseInsert:
Boolean; VAR OnDatabaseModify: Boolean; VAR OnDatabaseDelete: Boolean;
VAR OnDatabaseRename:Boolean)

After:

ChangeLogMgt.GetDatabaseTableTriggerSetup
(TableId,OnDatabaseInsert,OnDatabaseModify,
OnDatabaseDelete,OnDatabaseRename);
IntegrationManagement.GetDatabaseTableTriggerSetup
(TableId,OnDatabaseInsert,OnDatabaseModify,
OnDatabaseDelete,OnDatabaseRename);

Add:

//****Scribe Begins *****


ScribePublisher.GetTableTriggerSetup(TableId,OnDatabaseInsert,
OnDatabaseModify,OnDatabaseDelete,OnDatabaseRename);
//****Scribe Ends *****

l Trigger Function 2
OnDatabaseInsert (RecRef : RecordRef)

After:

ChangeLogMgt.LogInsertion(RecRef);
IntegrationManagement.OnDatabaseInsert(RecRef);

Add:

//****Scribe Begins *****


ScribePublisher.PublishInsertion(RecRef);
//****Scribe Ends *****

l Trigger Function 3
OnDatabaseModify (RecRef : RecordRef)

Before:

ChangeLogMgt

Add:

// *****Scribe Begins*****
xRecRef.GET(RecRef.RECORDID);
//*****Scribe Ends*****

After:

ChangeLogMgt.LogModification(RecRef);
IntegrationManagement.OnDatabaseModify(RecRef);

Add:

Dynamics NAV Adapter Version - 54 -


3.1.1
Editing codeunit 1 — Dynamics NAV 2013

//****Scribe Begins *****


ScribePublisher.PublishModification(RecRef,xRecRef);
//****Scribe Ends *****

In addition, in this section:

a. In the View menu, click C\AL locals.


b. Click the Variables tab and enter:

Name DataType Subtype Length

xRecRef RecordRef

l Trigger Function 4
OnDatabaseDelete

After:

ChangeLogMgt.LogDeletion(RecRef);
IntegrationManagement.OnDatabaseDelete(RecRef);

Add:

//****Scribe Begins *****


ScribePublisher.PublishDeletion(RecRef);
//****Scribe Ends *****

l Trigger Function 5
OnDatabaseRename (RecRef : RecordRef;xRecRef

After:

ChangeLogMgt.LogRename(RecRef,xRecRef);
IntegrationManagement.OnDatabaseRename(RecRef,xRecRef);

Add:

//****Scribe Begins *****


ScribePublisher.PublishRename(RecRef,xRecRef);
//****Scribe Ends *****

13. 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.

In the Object Designer, in the Version List column, edit the


ApplicationManagement codeunit's version to reflect the new revision
level.

Dynamics NAV Adapter Version - 55 -


3.1.1
Editing codeunit 44 — Dynamics NAV 2013

Editing Codeunit 44 — Dynamics NAV


2013
If codeunit 44 has been modified, you must add the appropriate Scribe code changes to the
codeunit design. Carefully editing codeunit 44 can preserve any changes that have already
been made to it.

The file COD44.txt resides in the NAS working directory subfolder that holds the Dynamics
NAV localization, database version, and build, for example: ..\Microsoft Dynamics
NAV\70\Service\Add-Ins\Scribe\ScribeModifications\W1.7.00.33781.

To edit the codeunit, use the .txt file that matches your version of Microsoft Dynamics NAV.
Scribe suggests that you review COD44.txt before editing codeunit 44.

To Edit Codeunit 44

1. Open the Microsoft Dynamics NAV Development Environment.


2. Click Tools > Object Designer. The Object Designer appears.
3. Click Codeunit ( ).
4. From the list of codeunits, select codeunit 44, NASManagement.
5. Click Design. The C/AL Editor appears.
6. Edit codeunit 44 NASManagement. Add the following at the start of the CASE
statement of the NasHandler:
After:

CASE Parameter OF
'JOBQUEUE':
CODEUNIT.RUN(CODEUNIT::"Job Queue - NAS Start Up");

Add:

//*****SCRIBE BEGINS*****
'SCRIBE':
CODEUNIT.RUN(CODEUNIT:: "Scribe Adapter Hooks");
//*****SCRIBE ENDS*****

7. 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.

Dynamics NAV Adapter Version - 56 -


3.1.1
Editing codeunit 80 — Dynamics NAV 2013

Editing Codeunit 80 — Dynamics NAV


2013
If codeunit 80 has been modified, you must add the appropriate Scribe code changes to the
codeunit design. Carefully editing codeunit 80 can preserve any changes that have already
been made to it.

The file COD80.txt resides in the NAS working directory subfolder that holds the Dynamics
NAV localization, database version, and build, for example: ..\Microsoft Dynamics
NAV\70\Service\Add-Ins\Scribe\ScribeModifications\W1.7.00.33781.

To edit the codeunit, use the .txt file that matches your version of Microsoft Dynamics NAV.
Scribe suggests that you review COD80.txt before editing codeunit 80.

Correcting The Window Variable Error

When running the PostSalesOrder custom action that wraps Codeunit 80


Sales-Post, an error message may appear saying that you cannot use C/AL
variables of type DIALOG when running the Application Server. This error is
caused by the global variable Window used in OnRun trigger.

To Correct The Window Variable Error

Dynamics NAV C/AL code requires BEGIN and END keywords encapsulating
compound statements. Where the “IF GUIALLOWED THEN:” statement is
added, if there are multiple lines of C/AL Code invoking the Window variable,
then the BEGIN and END keywords must be used to encapsulate all of lines of
code.

Add the following statement before all instances of the Window variable in the design
of codeunit 80:
IF GUIALLOWED THEN

For example, for the following statement:

Window.UPDATE(1,STRSUBSTNO(Text007,"Document
type","No.",SalesInvHeader."No."));
Add IF GUIALLOWED THEN:
//*****Scribe Begins*****
//Hide GUI window in NAS
IF GUIALLOWED THEN
Window.UPDATE(1,STRSUBSTNO(Text007,"Document
type","No.",SalesInvHeader."No."));
//*****Scribe Ends*****

Dynamics NAV Adapter Version - 57 -


3.1.1
Editing codeunit 80 — Dynamics NAV 2013

This eliminates the error message when the NAS runs codeunit 80.

Making Other Changes To Codeunit 80


After you correct the Window variable error, make the remaining required edits to codeunit
80.

To Edit Codeunit 80

1. Open the Microsoft Dynamics NAV Development Environment.


2. Click Tools > Object Designer. The Object Designer appears.
3. Click Codeunit ( ).
4. From the list of codeunits, select codeunit 80, Sales-Post.
5. Click Design. The C/AL Editor appears.
6. Click anywhere in the OnRun section of the open codeunit.
7. In the Microsoft Dynamics NAV 2013Development Environment, click View > C/AL
Locals.
8. On the Variables tab,add the following local variables:

Name DataType Subtype Length


ScribePublisher Codeunit Scribe Publisher
RecRef RecordRef

9. Close the C/AL Locals window to return to the C/AL Editor.


10. Click View > C/AL Globals. On the Variables tab, add the global variable:

Name DataType Subtype Length


CustLedgEntry Record Cust. Ledger Entry

11. Save and close C/AL Globals to return to the C/AL Editor.
12. In the OnRun section:
After:

SalesInvHeader.INSERT;

Add:

//*****Scribe Begins*****
// Trigger ScribePublisher
RecRef.GETTABLE(SalesInvHeader);
ScribePublisher.PublishInsertion(RecRef);
//*****Scribe Ends*****

After:

IF "Bal. Account No." <> '' THEN BEGIN:

Dynamics NAV Adapter Version - 58 -


3.1.1
Editing codeunit 80 — Dynamics NAV 2013

Replace:

// Balancing account
IF "Bal. Account No." <> '' THEN BEGIN
Window.UPDATE(5,1);
IF NOT IsOnlinePayment(SalesHeader) THEN
PostBalancing(0)

With:

// Balancing account
IF "Bal. Account No." <> '' THEN BEGIN
//*****SCRIBE BEGINS*****
//Hide GUI window in NAS

IF GUIALLOWED THEN
Window.UPDATE(5,1);
CustLedgEntry.FINDLAST;
GenJnlLine.INIT;
GenJnlLine."Posting Date" := "Posting Date";
GenJnlLine."Document Date" := "Document Date";
GenJnlLine.Description := "Posting Description";
GenJnlLine."Shortcut Dimension 1 CodeLeft" := "Shortcut Dimension 1
CodeLeft";
GenJnlLine."Shortcut Dimension 2 CodeLeft" := "Shortcut Dimension 2
CodeLeft";
GenJnlLine."Reason CodeLeft" := "Reason CodeLeft";
GenJnlLine."Account Type" := GenJnlLine."Account Type"::Customer;
GenJnlLine."Account No." := "Bill-to Customer No.";

IF "Document Type" = "Document Type"::"Credit Memo" THEN


GenJnlLine."Document Type" := GenJnlLine."Document Type"::Refund
ELSE
GenJnlLine."Document Type" := GenJnlLine."Document Type"::Payment;
GenJnlLine."Document No." := GenJnlLineDocNo;
GenJnlLine."External Document No." := GenJnlLineExtDocNo;

IF "Bal. Account Type" = "Bal. Account Type"::"Bank Account" THEN


GenJnlLine."Bal. Account Type" := GenJnlLine."Bal. Account Type"::"Bank
Account";
GenJnlLine."Bal. Account No." := "Bal. Account No.";
GenJnlLine."Currency CodeLeft" := "Currency CodeLeft";
GenJnlLine.Amount :=
TotalSalesLine."Amount Including VAT" + CustLedgEntry."Remaining Pmt. Disc.
Possible";
GenJnlLine."Source Currency CodeLeft" := "Currency CodeLeft";
GenJnlLine."Source Currency Amount" := GenJnlLine.Amount;
GenJnlLine.Correction := Correction;
CustLedgEntry.CALCFIELDS(Amount);

IF CustLedgEntry.Amount = 0 THEN
GenJnlLine."Amount (LCY)" := TotalSalesLineLCY."Amount Including VAT"
ELSE
GenJnlLine."Amount (LCY)" :=

Dynamics NAV Adapter Version - 59 -


3.1.1
Editing codeunit 80 — Dynamics NAV 2013

TotalSalesLineLCY."Amount Including VAT" +


ROUND(
CustLedgEntry."Remaining Pmt. Disc. Possible" /
CustLedgEntry."Adjusted Currency Factor");
IF SalesHeader."Currency CodeLeft" = '' THEN
GenJnlLine."Currency Factor" := 1
ELSE
GenJnlLine."Currency Factor" := SalesHeader."Currency Factor";
GenJnlLine."Applies-to Doc. Type" := GenJnlLineDocType;
GenJnlLine."Applies-to Doc. No." := GenJnlLineDocNo;
GenJnlLine."Source Type" := GenJnlLine."Source Type"::Customer;
GenJnlLine."Source No." := "Bill-to Customer No.";
GenJnlLine."Source CodeLeft" := SrcCode;
GenJnlLine."Posting No. Series" := "Posting No. Series";
GenJnlLine."IC Partner CodeLeft" := "Sell-to IC Partner CodeLeft";
GenJnlLine."Allow Zero-Amount Posting" := TRUE;
GenJnlPostLine.RunWithCheck(GenJnlLine);
//*****SCRIBE ENDS*****

13. 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.

Dynamics NAV Adapter Version - 60 -


3.1.1
Editing codeunit 414 — Dynamics NAV 2013

Editing Codeunit 414 — Dynamics NAV


2013
If codeunit 414 has been modified, you must add the appropriate Scribe code changes to
the codeunit design. Carefully editing codeunit 1 can preserve any changes that have
already been made to it.

The file COD414.txt resides in the NAS working directory subfolder that holds the
Dynamics NAV localization, database version, and build, for example: ..\Microsoft
Dynamics NAV\70\Service\Add-Ins\Scribe\ScribeModifications\W1.7.00.33781.

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

To Edit Codeunit 414

1. Open the Microsoft Dynamics NAV Development Environment.


2. Click Tools > Object Designer. The Object Designer appears.
3. Click Codeunit ( ).
4. From the list of codeunits, select codeunit 414, Release Sales Document.
5. Click Design . The C/AL Editor appears.
6. Click anywhere in the OnRun section of the open codeunit.
7. In Microsoft Dynamics NAV 2013 Development Environment, click View > C/AL
Locals.
8. On the Variables tab, add the following local variables:

Name DataType Subtype Length


ScribePublisher Codeunit Scribe Publisher
RecRef RecordRef
xRecRef RecordRef

9. Close the C/AL Locals window. You return to the C/AL Editor.
10. In the OnRun section, after the statement:
IF Status = Status::Released THEN EXIT;

Add the following:

// ***** SCRIBE BEGINS *****


// Get the RecordRef of the original record
xRecRef.GETTABLE(Rec);
// ***** SCRIBE ENDS *****

11. Before the Reopen section begins, add:

Dynamics NAV Adapter Version - 61 -


3.1.1
Editing codeunit 414 — Dynamics NAV 2013

// ***** SCRIBE BEGINS *****


// Trigger the Scribe Publisher
RecRef.GETTABLE(Rec);
ScribePublisher.PublishModification(RecRef,xRecRef);
// ***** SCRIBE ENDS *****

12. In the C/AL Editor, click in the Reopen section of the codeunit, then open the C/AL
Locals window.
13. Click the Variables tab, then add the following variables:

Name DataType Subtype Length


ScribePublisher Codeunit Scribe Publisher
RecRef RecordRef
xRecRef RecordRef

14. Close the C/AL Locals window to return to the C/AL Editor.
15. In the Reopen section:
After:

IF Status = Status::Open THEN EXIT;

Add :

// ***** SCRIBE BEGINS *****


// Get RecordRef of the original record
xRecRef.GETTABLE(SalesHeader);
// ***** SCRIBE ENDS *****

After :

WhseSalesRelease.Reopen(SalesHeader);WhseSalesRelease.Reopen(SalesHeader);

Add :

// ***** SCRIBE BEGINS *****


RecRef.GETTABLE(SalesHeader);
ScribePublisher.PublishModification(RecRef,xRecRef);
// ***** SCRIBE ENDS *****

16. 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.

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

Dynamics NAV Adapter Version - 62 -


3.1.1
Editing the codeunits — Dynamics NAV 2013 R2

Editing The Codeunits — Dynamics NAV


2013 R2
For Dynamics NAV to work with Scribe Insight, you must modify the codeunits for each
targeted database to:

l Provide the entry point for Scribe’s NAS-based custom logic


l Allow Scribe to publish updates, inserts, and deletes from the database
The steps to add the Scribe changes to the codeunits vary depending on whether your
codeunits have been modified.

If the codeunits have been modified, or if you do not know whether they have
been modified, Scribe suggests manually editing each codeunit file, as
described below, to preserve any previous changes.

Making The Scribe Changes To A Modified Codeunit


If the codeunit has been modified, edit the codeunit to add the Scribe code changes while
preserving any modifications that have already been made to codeunit.

Your Dynamics NAV license must have appropriate permissions to open the


C/AL editor. For information, see your Dynamics NAV Administrator.

No changes are required for codeunit 86 for adapters for Dynamics NAV 2013
R2, Dynamics NAV 2015, or Dynamics NAV 2016.

Making The Scribe Changes To An Unmodified Codeunit


If you are sure that the codeunit does not contain any non-Scribe modifications and you are
running a Dynamics NAV W1 system, you can import the W1.7.10.35473.fob to update all of
the codeunits with Scribe modifications. These codeunits replace the standard codeunits but
contain a number of Scribe-specific changes.

Dynamics NAV Adapter Version - 63 -


3.1.1
Editing codeunit 1 — Dynamics NAV 2013 R2

Editing Codeunit 1 — Dynamics


NAV 2013 R2
If codeunit 1 has been modified, add the appropriate Scribe 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\70\Service\Add-Ins\Scribe\ScribeModifications\W1.7.10.35473.

To edit the codeunit, use the .txt file that matches your version of Dynamics NAV. Scribe
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 ( ).
4. From the list of codeunits, select codeunit 1, ApplicationManagement at the top of
the list.
5. Click Design to open the C/AL Editor.
6. After it is open, click anywhere in the codeunit design.
7. In Microsoft Dynamics NAV 2013 R2 Development Environment, click View> C/AL
Globals.
8. On the Functions tab, select the GetDatabaseTableTriggerSetup global trigger
function, then click Locals.
9. On the Variables tab, create a ScribePublisher variable as noted below, then close
this window.
Global trigger functions must have these local variables.

Name DataType Subtype Length


ScribePublisher Codeunit Scribe Publisher

10. 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:
l OnDatabaseInsert
l OnDatabaseModify
l OnDatabaseDelete
l OnDatabaseRename
11. Close the C/AL Globals window. You return to the C/AL Editor.

Dynamics NAV Adapter Version - 64 -


3.1.1
Editing codeunit 1 — Dynamics NAV 2013 R2

12. In codeunit 1 ApplicationManagement, edit the following global trigger functions:


l Trigger Function 1
GetDatabaseTableTriggerSetup(TableID: Integer; VAR OnDatabaseInsert:
Boolean; VAR OnDatabaseModify: Boolean; VAR OnDatabaseDelete: Boolean;
VAR OnDatabaseRename:Boolean)

After:
IntegrationManagement.GetDatabaseTableTriggerSetup
(TableId,OnDatabaseInsert,OnDatabaseModify,
OnDatabaseDelete,OnDatabaseRename);
IntegrationManagement.GetDatabaseTableTriggerSetup
(TableId,OnDatabaseInsert,OnDatabaseModify,
OnDatabaseDelete,OnDatabaseRename);

Add:

//****Scribe Begins *****


ScribePublisher.GetTableTriggerSetup(TableId,OnDatabaseInsert,
OnDatabaseModify,OnDatabaseDelete,OnDatabaseRename);
//****Scribe Ends *****

l Trigger Function 2
OnDatabaseInsert (RecRef : RecordRef)

After:

ChangeLogMgt.LogInsertion(RecRef);
IntegrationManagement.OnDatabaseInsert(RecRef);

Add:

//****Scribe Begins *****


ScribePublisher.PublishInsertion(RecRef);
//****Scribe Ends *****

l Trigger Function 3
OnDatabaseModify (RecRef : RecordRef)

Before:
ChangeLogMgt

Add:

// *****Scribe Begins*****
IF xRecRef.GET(RecRef.RECORDID) THEN
BEGIN
publishUpdate:=True
END;
//*****Scribe Ends*****

Dynamics NAV Adapter Version - 65 -


3.1.1
Editing codeunit 1 — Dynamics NAV 2013 R2

In the View menu, click C\AL locals. > Variables tab and enter:

Name DataType Subtype Length

publishUpdate Boolean

After:
ChangeLogMgt.LogModification(RecRef);
IntegrationManagement.OnDatabaseModify(RecRef);

Add:

//****Scribe Begins *****


ScribePublisher.PublishModification(RecRef,xRecRef);
//****Scribe Ends *****

In the View menu, click C\AL locals.> Variables tab and enter:

Name DataType Subtype Length

xRecRef RecordRef

After:
ChangeLogMgt.LogDeletion(RecRef);
IntegrationManagement.OnDatabaseDelete(RecRef);

Add:

//****Scribe Begins *****


if publishUpdate THEN
ScribePublisher.PublishModification(RecRef,xRecRef);
//****Scribe Ends *****

l Trigger Function 4
OnDatabaseDelete

After:
ChangeLogMgt.LogDeletion(RecRef);
IntegrationManagement.OnDatabaseDelete(RecRef);

Add:

//****Scribe Begins *****


ScribePublisher.PublishDeletion(RecRef);
//****Scribe Ends *****

l Trigger Function 5
OnDatabaseRename (RecRef : RecordRef;xRecRef :

Dynamics NAV Adapter Version - 66 -


3.1.1
Editing codeunit 1 — Dynamics NAV 2013 R2

After:
ChangeLogMgt.LogRename(RecRef,xRecRef);
IntegrationManagement.OnDatabaseRename(RecRef,xRecRef);

Add:

//****Scribe Begins *****


ScribePublisher.PublishRename(RecRef,xRecRef);
//****Scribe Ends *****

13. 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.

In the Object Designer, in the Version List column, edit the


ApplicationManagement codeunit's version to reflect the new revision
level.

Dynamics NAV Adapter Version - 67 -


3.1.1
Editing codeunit 44 — Dynamics NAV 2013 R2

Editing Codeunit 44 — Dynamics


NAV 2013 R2
If codeunit 44 has been modified, add the appropriate Scribe code changes to the codeunit
design. Carefully editing codeunit 44 can preserve any changes that have already been
made to it.

The file COD44.txt resides in the NAS working directory subfolder that holds the Dynamics
NAV localization, database version, and build, for example: ..\Microsoft Dynamics
NAV\70\Service\Add-Ins\Scribe\ScribeModifications\W1.7.10.35473.

To edit the codeunit, use the .txt file that matches your version of Microsoft Dynamics NAV.
Scribe suggests that you review COD44.txt before editing codeunit 44.

To Edit Codeunit 44

1. Open the Microsoft Dynamics NAV Development Environment.


2. Click Tools > Object Designer. The Object Designer appears.
3. Click Codeunit ( ).
4. From the list of codeunits, select codeunit 44, NASManagement.
5. Click Design. The C/AL Editor appears.
6. Edit codeunit 44 NASManagement. Add the following at the start of the CASE
statement of the NasHandler:
After:

CASE Parameter OF
'JOBQUEUE':
CODEUNIT.RUN(CODEUNIT::"Job Queue - NAS Start Up");

Add:

//*****SCRIBE BEGINS*****
'SCRIBE':
CODEUNIT.RUN(CODEUNIT:: "Scribe Adapter Hooks");
//*****SCRIBE ENDS*****

7. 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.

Dynamics NAV Adapter Version - 68 -


3.1.1
Editing codeunit 80 — Dynamics NAV 2013 R2

Editing Codeunit 80 — Dynamics


NAV 2013 R2
If codeunit 80 has been modified, add the appropriate Scribe code changes to the codeunit
design. Carefully editing codeunit 80 can preserve any changes that have already been
made to it.

The file COD80.txt resides in the NAS working directory subfolder that holds the Dynamics
NAV localization, database version, and build, for example: ..\Microsoft Dynamics
NAV\70\Service\Add-Ins\Scribe\ScribeModifications\W1.7.10.35473.

To edit the codeunit, use the .txt file that matches your version of Microsoft Dynamics NAV.
Scribe suggests that you review COD80.txt before editing codeunit 80.

Correcting The Window Variable Error

When running the PostSalesOrder custom action which wraps Codeunit 80


Sales-Post, you may get an error message saying that you cannot use C/AL
variables of type DIALOG when running the Application Server. This error is
caused by the global variable Window used in OnRun trigger.

To Correct The Window Variable Error

Dynamics NAV C/AL code requires BEGIN and END keywords encapsulating
compound statements. Where the “IF GUIALLOWED THEN:” statement is
added, if there are multiple lines of C/AL Code invoking the Window variable,
then the BEGIN and END keywords must be used to encapsulate all of lines of
code.

Add the following statement before all instances of the Window variable in the
design of codeunit 80:
IF GUIALLOWEDTHEN

For example, for the following statement:

Window.UPDATE(1,STRSUBSTNO(Text007,"Document
type","No.",SalesInvHeader."No."));

Add IF GUIALLOWED THEN:

//*****Scribe Begins*****
//Hide GUI window in NAS
IF GUIALLOWED THEN
Window.UPDATE(1,STRSUBSTNO(Text007,"Document
type","No.",SalesInvHeader."No."));
//*****Scribe Ends*****

Dynamics NAV Adapter Version - 69 -


3.1.1
Editing codeunit 80 — Dynamics NAV 2013 R2

This eliminates the error message when the NAS runs codeunit 80.

Making Other Changes To Codeunit 80


After you correct the Window variable error, make the remaining required edits to codeunit
80.

To Edit Codeunit 80

1. Open the Microsoft Dynamics NAV Development Environment.


2. Click Tools > Object Designer. The Object Designer appears.
3. Click Codeunit ( ).
4. From the list of codeunits, select codeunit 80, Sales-Post.
5. Click Design to open the C/AL Editor.
6. Click anywhere in the OnRun section of the open codeunit.
7. In Microsoft Dynamics NAV 2013 R2 Development Environment, click View > C/AL
Locals.
8. On the Variables tab,add the following local variables:

Name DataType Subtype Length


ScribePublisher Codeunit Scribe Publisher
RecRef RecordRef

9. Close the C/AL Locals window to return to the C/AL Editor.


10. Click View > C/AL Globals. On the Variables tab, add the global variable:

Name DataType Subtype Length


CustLedgEntry Record Cust. Ledger Entry

11. Save and close C/AL Globals to return to the C/AL Editor.
12. In the OnRun section:
After:

SalesInvHeader.INSERT

Add:

//*****Scribe Begins*****
// Trigger ScribePublisher
RecRef.GETTABLE(SalesInvHeader);
ScribePublisher.PublishInsertion(RecRef);
//*****Scribe Ends*****

After:

IF "Bal. Account No." <> '' THEN BEGIN:

Dynamics NAV Adapter Version - 70 -


3.1.1
Editing codeunit 80 — Dynamics NAV 2013 R2

Replace:

// Balancing account
IF "Bal. Account No." <> '' THEN BEGIN
Window.UPDATE(5,1);
IF NOT IsOnlinePayment(SalesHeader) THEN
PostBalancing(0)

With:

// Balancing account
IF "Bal. Account No." <> '' THEN BEGIN
//*****SCRIBE BEGINS*****
//Hide GUI window in NAS
IF GUIALLOWED THEN
Window.UPDATE(5,1);
CustLedgEntry.FINDLAST;
GenJnlLine.INIT;
GenJnlLine."Posting Date" := "Posting Date";
GenJnlLine."Document Date" := "Document Date";
GenJnlLine.Description := "Posting Description";
GenJnlLine."Shortcut Dimension 1 CodeLeft" := "Shortcut Dimension 1
CodeLeft";
GenJnlLine."Shortcut Dimension 2 CodeLeft" := "Shortcut Dimension 2
CodeLeft";
GenJnlLine."Reason CodeLeft" := "Reason CodeLeft";
GenJnlLine."Account Type" := GenJnlLine."Account Type"::Customer;
GenJnlLine."Account No." := "Bill-to Customer No.";
IF "Document Type" = "Document Type"::"Credit Memo" THEN
GenJnlLine."Document Type" := GenJnlLine."Document Type"::Refund
ELSE
GenJnlLine."Document Type" := GenJnlLine."Document Type"::Payment;
GenJnlLine."Document No." := GenJnlLineDocNo;
GenJnlLine."External Document No." := GenJnlLineExtDocNo;

IF "Bal. Account Type" = "Bal. Account Type"::"Bank Account" THEN


GenJnlLine."Bal. Account Type" := GenJnlLine."Bal. Account Type"::"Bank
Account";
GenJnlLine."Bal. Account No." := "Bal. Account No.";
GenJnlLine."Currency CodeLeft" := "Currency CodeLeft";
GenJnlLine.Amount :=
TotalSalesLine."Amount Including VAT" + CustLedgEntry."Remaining Pmt. Disc.
Possible";
GenJnlLine."Source Currency CodeLeft" := "Currency CodeLeft";
GenJnlLine."Source Currency Amount" := GenJnlLine.Amount;
GenJnlLine.Correction := Correction;
CustLedgEntry.CALCFIELDS(Amount);

IF CustLedgEntry.Amount = 0 THEN
GenJnlLine."Amount (LCY)" := TotalSalesLineLCY."Amount Including VAT"
ELSE
GenJnlLine."Amount (LCY)" :=
TotalSalesLineLCY."Amount Including VAT" +
ROUND(

Dynamics NAV Adapter Version - 71 -


3.1.1
Editing codeunit 80 — Dynamics NAV 2013 R2

CustLedgEntry."Remaining Pmt. Disc. Possible" /


CustLedgEntry."Adjusted Currency Factor");
IF SalesHeader."Currency CodeLeft" = '' THEN
GenJnlLine."Currency Factor" := 1
ELSE
GenJnlLine."Currency Factor" := SalesHeader."Currency Factor";
GenJnlLine."Applies-to Doc. Type" := GenJnlLineDocType;
GenJnlLine."Applies-to Doc. No." := GenJnlLineDocNo;
GenJnlLine."Source Type" := GenJnlLine."Source Type"::Customer;
GenJnlLine."Source No." := "Bill-to Customer No.";
GenJnlLine."Source CodeLeft" := SrcCode;
GenJnlLine."Posting No. Series" := "Posting No. Series";
GenJnlLine."IC Partner CodeLeft" := "Sell-to IC Partner CodeLeft";
GenJnlLine."Allow Zero-Amount Posting" := TRUE;
GenJnlPostLine.RunWithCheck(GenJnlLine);
//*****SCRIBE ENDS*****

13. 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.

Dynamics NAV Adapter Version - 72 -


3.1.1
Editing codeunit 414 — Dynamics NAV 2013 R2

Editing Codeunit 414 — Dynamics


NAV 2013 R2
If codeunit 414 has been modified, add the appropriate Scribe code changes to the codeunit
design. Carefully editing codeunit 1 can preserve any changes that have already been made
to it.

The file COD414.txt resides in the NAS working directory subfolder that holds the
Dynamics NAV localization, database version, and build, for example: ..\Microsoft
Dynamics NAV\70\Service\Add-Ins\Scribe\ScribeModifications\W1.7.10.35473.

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

To Edit Codeunit 414

1. Open the Microsoft Dynamics NAV Development Environment.


2. Click Tools > Object Designer. The Object Designer appears.
3. Click Codeunit ( ).
4. From the list of codeunits, select codeunit 414, Release Sales Document.
5. Click Design to open the C/AL Editor.
6. Click anywhere in the OnRun section of the open codeunit.
7. In Microsoft Dynamics NAV 2013 R2 Development Environment, click View > C/AL
Locals.
8. On the Variables tab, add the following local variables:

Name DataType Subtype Length


ScribePublisher Codeunit Scribe Publisher
RecRef RecordRef
xRecRef RecordRef

9. Close the C/AL Locals window to return to the C/AL Editor.


10. In the OnRun section:
After:

IF Status = Status::Released THEN EXIT;

Add:

// ***** SCRIBE BEGINS *****


// Get the RecordRef of the original record
xRecRef.GETTABLE(Rec);
// ***** SCRIBE ENDS *****

Dynamics NAV Adapter Version - 73 -


3.1.1
Editing codeunit 414 — Dynamics NAV 2013 R2

11. At the end of the OnRun section just before the Reopen section begins:
Add:

// ***** SCRIBE BEGINS *****


// Trigger the Scribe Publisher
RecRef.GETTABLE(Rec);
ScribePublisher.PublishModification(RecRef,xRecRef);
// ***** SCRIBE ENDS *****

12. In the C/AL Editor, click in the Reopen section of the codeunit, then open the C/AL
Locals window.
13. Click the Variables tab, then add the following variables:

Name DataType Subtype Length


ScribePublisher Codeunit Scribe Publisher
RecRef RecordRef
xRecRef RecordRef

14. Close the C/AL Locals window to return to the C/AL Editor.
15. In the Reopen section:
After: 

IF Status = Status::Open THEN EXIT;

Add:

// ***** SCRIBE BEGINS *****


// Get RecordRef of the original record
xRecRef.GETTABLE(SalesHeader);
// ***** SCRIBE ENDS *****

After: 

WhseSalesRelease.Reopen(SalesHeader);

Add:

// ***** SCRIBE BEGINS *****


RecRef.GETTABLE(SalesHeader);
ScribePublisher.PublishModification(RecRef,xRecRef);
// ***** SCRIBE ENDS *****

16. 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.

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

Dynamics NAV Adapter Version - 74 -


3.1.1
Editing the codeunits — Dynamics NAV 2015

Editing The Codeunits — Dynamics NAV


2015
For Dynamics NAV to work with Scribe Insight, you must modify the codeunits for each
targeted database to:

l Provide the entry point for Scribe’s NAS-based custom logic


l Allow Scribe to publish updates, inserts, and deletes from the database
The steps to add the Scribe changes to the codeunits vary depending on whether your
codeunits have been modified.

If the codeunits have been modified, or if you do not know whether they have
been modified, Scribe suggests manually editing each codeunit file, as
described below, to preserve any previous changes.

Making The Scribe Changes To A Modified Codeunit


If the codeunit has been modified, edit the codeunit to add the Scribe code changes while
preserving any modifications that have already been made to codeunit.

Your Dynamics NAV license must have appropriate permissions to open the


C/AL editor. For information, see your Dynamics NAV Administrator.

No changes are required for codeunit 86 for adapters for Dynamics NAV 2013
R2, Dynamics NAV 2015, or Dynamics NAV 2016.

Making The Scribe Changes To An Unmodified Codeunit


If you are sure that the codeunit does not contain any non-Scribe modifications and you are
running a Dynamics NAV W1 system, you can import the W1.8.0.37874.fob to update all of
the codeunits with Scribe modifications. These codeunits replace the standard codeunits but
contain a number of Scribe-specific changes.

Dynamics NAV Adapter Version - 75 -


3.1.1
Editing codeunit 1 — Dynamics NAV 2015

Editing Codeunit 1 — Dynamics NAV


2015
If codeunit 1 has been modified, add the appropriate Scribe 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\80\Service\Add-Ins\Scribe\ScribeModifications\W1.8.0.37874.

To edit the codeunit, use the .txt file that matches your version of Dynamics NAV. Scribe
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 ( ).
4. From the list of codeunits, select codeunit 1, ApplicationManagement at the top of
the list.
5. Click Design to open the C/AL Editor.
6. After it is open, click anywhere in the codeunit design.
7. On the Microsoft Dynamics NAV 2015 Development Environment View menu, click
C/AL Globals.
8. On the Functions tab, select the GetDatabaseTableTriggerSetup global trigger
function, then click Locals.
9. On the Variables tab, create a ScribePublisher variable as noted below, then close
this window.
Global trigger functions must have these local variables.

Name DataType Subtype Length


ScribePublisher Codeunit Scribe Publisher

10. 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:
l OnDatabaseInsert
l OnDatabaseModify
l OnDatabaseDelete
l OnDatabaseRename
11. Close the C/AL Globals window to return to the C/AL Editor.

Dynamics NAV Adapter Version - 76 -


3.1.1
Editing codeunit 1 — Dynamics NAV 2015

12. In codeunit 1 ApplicationManagement, edit the following global trigger functions:


l Trigger Function 1
GetDatabaseTableTriggerSetup(TableID: Integer; VAR OnDatabaseInsert:
Boolean; VAR OnDatabaseModify: Boolean; VAR OnDatabaseDelete: Boolean;
VAR OnDatabaseRename:Boolean)

After:

ChangeLogMgt.GetDatabaseTableTriggerSetup
(TableId,OnDatabaseInsert,OnDatabaseModify,
OnDatabaseDelete,OnDatabaseRename);
IntegrationManagement.GetDatabaseTableTriggerSetup
(TableId,OnDatabaseInsert,OnDatabaseModify,
OnDatabaseDelete,OnDatabaseRename);

Add:

//****Scribe Begins *****


ScribePublisher.GetTableTriggerSetup(TableId,OnDatabaseInsert,
OnDatabaseModify,OnDatabaseDelete,OnDatabaseRename);
//****Scribe Ends *****

l Trigger Function 2
OnDatabaseInsert (RecRef : RecordRef)

After:

ChangeLogMgt.LogInsertion(RecRef);
IntegrationManagement.OnDatabaseInsert(RecRef);

Add:

//****Scribe Begins *****


IF RecRef.GET(RecRef.RECORDID) THEN
ScribePublisher.PublishInsertion(RecRef);
//****Scribe Ends *****

This added statement prevents Inserts from being published,


reducing the clutter that may occur when creating records. For
example, Dynamics NAV counts an Insert as both an Insert and a
Modify for most entities and generates two messages. However,
this line also prevents some other entities, such as Sales Line,
from publishing Inserts.

If you require Inserts to be published, comment out the following


line from the added code:

IF RecRef.GET(RecRef.RECORDID) THEN

Dynamics NAV Adapter Version - 77 -


3.1.1
Editing codeunit 1 — Dynamics NAV 2015

l Trigger Function 3
OnDatabaseModify (RecRef : RecordRef)

In the View menu, click C\AL locals.> Variables tab and enter:

Name DataType Subtype Length

publishUpdate Boolean

Before:

ChangeLogMgt

Add:

// *****Scribe Begins*****
IF xRecRef.GET(RecRef.RECORDID) THEN
BEGIN
publishUpdate:=True
END;
//*****Scribe Ends*****

In the View menu, click C\AL locals.> Variables tab and enter:

Name DataType Subtype Length

xRecRef RecordRef

After:

ChangeLogMgt.LogModification(RecRef);
IntegrationManagement.OnDatabaseModify(RecRef);

Add:

//****Scribe Begins *****


if publishUpdate THEN
ScribePublisher.PublishModification(RecRef,xRecRef);
//****Scribe Ends *****

l Trigger Function 4
OnDatabaseDelete

After:

ChangeLogMgt.LogDeletion(RecRef);
IntegrationManagement.OnDatabaseDelete(RecRef);

Add:

//****Scribe Begins *****


IF RecRef.GET(RecRef.RECORDID) THEN
ScribePublisher.PublishDeletion(RecRef);
//****Scribe Ends *****

Dynamics NAV Adapter Version - 78 -


3.1.1
Editing codeunit 1 — Dynamics NAV 2015

l Trigger Function 5
OnDatabaseRename (RecRef : RecordRef;xRecRef :

After:

ChangeLogMgt.LogRename(RecRef,xRecRef);
IntegrationManagement.OnDatabaseRename(RecRef,xRecRef);

Add:

//****Scribe Begins *****


IF RecRef.GET(RecRef.RECORDID) THEN
ScribePublisher.PublishRename(RecRef,xRecRef);
//****Scribe Ends *****

13. 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.

In the Object Designer, in the Version List column, edit the


ApplicationManagement codeunit's version to reflect the new revision
level.

Dynamics NAV Adapter Version - 79 -


3.1.1
Editing codeunit 44 — Dynamics NAV 2015

Editing Codeunit 44 — Dynamics NAV


2015
If codeunit 44 has been modified, add the appropriate Scribe code changes to the codeunit
design. Carefully editing codeunit 44 can preserve any changes that have already been
made to it.

The file COD44.txt resides in the NAS working directory subfolder that holds the Dynamics
NAV localization, database version, and build, for example: ..\Microsoft Dynamics
NAV\80\Service\Add-Ins\Scribe\ScribeModifications\W1.8.0.37874.

To edit the codeunit, use the .txt file that matches your version of Microsoft Dynamics NAV.
Scribe suggests that you review COD44.txt before editing codeunit 44.

To Edit Codeunit 44

1. Open the Microsoft Dynamics NAV Development Environment.


2. Click Tools > Object Designer. The Object Designer appears.
3. Click Codeunit ( ).
4. From the list of codeunits, select codeunit 44, NASManagement.
5. Click Design to open the C/AL Editor.
6. Edit codeunit 44 NASManagement. Add the following at the start of the CASE
statement of the NasHandler:
After:

CASE Parameter OF
'JOBQUEUE':
CODEUNIT.RUN(CODEUNIT::"Job Queue - NAS Start Up");

Add:

//*****SCRIBE BEGINS*****
'SCRIBE':
CODEUNIT.RUN(CODEUNIT:: "Scribe Adapter Hooks");
//*****SCRIBE ENDS*****

7. 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.

Dynamics NAV Adapter Version - 80 -


3.1.1
Editing codeunit 80 — Dynamics NAV 2015

Editing Codeunit 80 — Dynamics NAV


2015
If codeunit 80 has been modified, you must add the appropriate Scribe code changes to the
codeunit design. Carefully editing codeunit 80 can preserve any changes that have already
been made to it.

The file COD80.txt resides in the NAS working directory subfolder that holds the Dynamics
NAV localization, database version, and build, for example: ..\Microsoft Dynamics
NAV\80\Service\Add-Ins\Scribe\ScribeModifications\W1.8.0.37874.

To edit the codeunit, use the .txt file that matches your version of Microsoft Dynamics NAV.
Scribe suggests that you review COD80.txt before editing codeunit 80.

Correcting The Window Variable Error

When running the PostSalesOrder custom action which wraps Codeunit 80


Sales-Post, you may get an error message saying that you cannot use C/AL
variables of type DIALOG when running the Application Server. This error is
caused by the global variable Window used in OnRun trigger.

To Correct The Window Variable Error

Dynamics NAV C/AL code requires BEGIN and END keywords encapsulating
compound statements. Where the “IF GUIALLOWED THEN:” statement is
added, if there are multiple lines of C/AL Code invoking the Window variable,
then the BEGIN and END keywords must be used to encapsulate all of lines of
code.

Add the following statement before all instances of the Window variable in the
design of codeunit 80:
IF GUIALLOWEDTHEN

For example, for the following statement:

Window.UPDATE(1,STRSUBSTNO(Text007,"Document
type","No.",SalesInvHeader."No."));

Add IF GUIALLOWED THEN:

//*****Scribe Begins*****
//Hide GUI window in NAS
IF GUIALLOWED THEN
Window.UPDATE(1,STRSUBSTNO(Text007,"Document
type","No.",SalesInvHeader."No."));
//*****Scribe Ends*****

Dynamics NAV Adapter Version - 81 -


3.1.1
Editing codeunit 80 — Dynamics NAV 2015

This eliminates the error message when the NAS runs codeunit 80.

Making Other Changes To Codeunit 80


After you correct the Window variable error, make the remaining required edits to codeunit
80.

To Edit Codeunit 80

1. Open the Microsoft Dynamics NAV Development Environment.


2. Click Tools > Object Designer. The Object Designer appears.
3. Click Codeunit ( ).
4. From the list of codeunits, select codeunit 80, Sales-Post.
5. Click Design. The C/AL Editor appears.
6. Click anywhere in the OnRun section of the open codeunit.
7. On the Microsoft Dynamics NAV 2015 Development Environment, click View > C/AL
Locals.
8. On the Variables tab,add the following local variables:

Name DataType Subtype Length


ScribePublisher Codeunit Scribe Publisher
RecRef RecordRef

9. Close the C/AL Locals window. You return to the C/AL Editor.
10. Click View > C/AL Globals.
11. On the Variablestab, add the global variable:

Name DataType Subtype Length


CustLedgEntry Record Cust. Ledger Entry

12. Save and close C/AL Globals. You return to the C/AL Editor.
13. In the OnRun section:
After:

SalesInvHeader.INSERT

Add:

//*****Scribe Begins*****
// Trigger ScribePublisher
RecRef.GETTABLE(SalesInvHeader);
ScribePublisher.PublishInsertion(RecRef);
//*****Scribe Ends*****

After:

IF "Bal. Account No." <> '' THEN BEGIN:

Dynamics NAV Adapter Version - 82 -


3.1.1
Editing codeunit 80 — Dynamics NAV 2015

Replace:

// Balancing account
IF "Bal. Account No." <> '' THEN BEGIN
Window.UPDATE(5,1);
IF NOT IsOnlinePayment(SalesHeader) THEN
PostBalancing(0)

With:

// Balancing account
IF "Bal. Account No." <> '' THEN BEGIN
//*****SCRIBE BEGINS*****
//Hide GUI window in NAS
IF GUIALLOWED THEN
Window.UPDATE(5,1);
CustLedgEntry.FINDLAST;
GenJnlLine.INIT;
GenJnlLine."Posting Date" := "Posting Date";
GenJnlLine."Document Date" := "Document Date";
GenJnlLine.Description := "Posting Description";
GenJnlLine."Shortcut Dimension 1 Code" := "Shortcut Dimension 1 Code";
GenJnlLine."Shortcut Dimension 2 Code" := "Shortcut Dimension 2 Code";
GenJnlLine."Reason Code" := "Reason Code";
GenJnlLine."Account Type" := GenJnlLine."Account Type"::Customer;
GenJnlLine."Account No." := "Bill-to Customer No.";
IF "Document Type" = "Document Type"::"Credit Memo" THEN
GenJnlLine."Document Type" := GenJnlLine."Document Type"::Refund
ELSE
GenJnlLine."Document Type" := GenJnlLine."Document Type"::Payment;
GenJnlLine."Document No." := GenJnlLineDocNo;
GenJnlLine."External Document No." := GenJnlLineExtDocNo;
IF "Bal. Account Type" = "Bal. Account Type"::"Bank Account" THEN
GenJnlLine."Bal. Account Type" := GenJnlLine."Bal. Account Type"::"Bank
Account";
GenJnlLine."Bal. Account No." := "Bal. Account No.";
GenJnlLine."Currency Code" := "Currency Code";
GenJnlLine.Amount :=
TotalSalesLine."Amount Including VAT" + CustLedgEntry."Remaining Pmt. Disc.
Possible";
GenJnlLine."Source Currency Code" := "Currency Code";
GenJnlLine."Source Currency Amount" := GenJnlLine.Amount;
GenJnlLine.Correction := Correction;
CustLedgEntry.CALCFIELDS(Amount);
IF CustLedgEntry.Amount = 0 THEN
GenJnlLine."Amount (LCY)" := TotalSalesLineLCY."Amount Including VAT"
ELSE
GenJnlLine."Amount (LCY)" :=
TotalSalesLineLCY."Amount Including VAT" + ROUND(
CustLedgEntry."Remaining Pmt. Disc. Possible" /
CustLedgEntry."Adjusted Currency Factor");

Dynamics NAV Adapter Version - 83 -


3.1.1
Editing codeunit 80 — Dynamics NAV 2015

IF SalesHeader."Currency Code" = '' THEN


GenJnlLine."Currency Factor" := 1
ELSE
GenJnlLine."Currency Factor" := SalesHeader."Currency Factor";
GenJnlLine."Applies-to Doc. Type" := GenJnlLineDocType;
GenJnlLine."Applies-to Doc. No." := GenJnlLineDocNo;
GenJnlLine."Source Type" := GenJnlLine."Source Type"::Customer;
GenJnlLine."Source No." := "Bill-to Customer No.";
GenJnlLine."Source Code" := SrcCode;
GenJnlLine."Posting No. Series" := "Posting No. Series";
GenJnlLine."IC Partner Code" := "Sell-to IC Partner Code";
GenJnlLine."Allow Zero-Amount Posting" := TRUE;
GenJnlPostLine.RunWithCheck(GenJnlLine);
//*****Scribe Ends*****

14. 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.

Dynamics NAV Adapter Version - 84 -


3.1.1
Editing codeunit 414 — Dynamics NAV 2015

Editing Codeunit 414 — Dynamics NAV


2015
If codeunit 414 has been modified, add the appropriate Scribe code changes to the codeunit
design. Carefully editing codeunit 1 can preserve any changes that have already been made
to it.

The file COD414.txt resides in the NAS working directory subfolder that holds the
Dynamics NAV localization, database version, and build, for example: ..\Microsoft
Dynamics NAV\80\Service\Add-Ins\Scribe\ScribeModifications\W1.8.0.37874.

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

To Edit Codeunit 414

1. Open the Microsoft Dynamics NAV Development Environment.


2. Click Tools > Object Designer. The Object Designer appears.
3. Click Codeunit ( ).
4. From the list of codeunits, select codeunit 414, Release Sales Document.
5. Click Design to open the C/AL Editor.
6. Click anywhere in the OnRun section of the open codeunit.
7. On Microsoft Dynamics NAV 2015 Development Environment View menu, click C/AL
Locals.
8. On the Variables tab, add the following local variables:

Name DataType Subtype Length


ScribePublisher Codeunit Scribe Publisher
RecRef RecordRef
xRecRef RecordRef

9. Close the C/AL Locals window to return to the C/AL Editor.


10. In the OnRun section:
After:

IF Status = Status::Released THEN EXIT;

Add:

// ***** SCRIBE BEGINS *****


// Get the RecordRef of the original record
xRecRef.GETTABLE(Rec);
// ***** SCRIBE ENDS *****

Dynamics NAV Adapter Version - 85 -


3.1.1
Editing codeunit 414 — Dynamics NAV 2015

11. At the end of the OnRun section just before the Reopen section begins:
Add:

// ***** SCRIBE BEGINS *****


// Trigger the Scribe Publisher
RecRef.GETTABLE(Rec);
ScribePublisher.PublishModification(RecRef,xRecRef);
// ***** SCRIBE ENDS *****

12. In the C/AL Editor, click in the Reopen section of the codeunit, then open the C/AL
Locals window.
13. Click the Variables tab, then add the following variables:

Name DataType Subtype Length


ScribePublisher Codeunit Scribe Publisher
RecRef RecordRef
xRecRef RecordRef

14. Close the C/AL Locals window to return to the C/AL Editor.
15. In the Reopen section:
After: 

IF Status = Status::Open THEN EXIT;

Add:

// ***** SCRIBE BEGINS *****


// Get RecordRef of the original record
xRecRef.GETTABLE(SalesHeader);
// ***** SCRIBE ENDS *****

After: 

WhseSalesRelease.Reopen(SalesHeader);

Add:

// ***** SCRIBE BEGINS *****


RecRef.GETTABLE(SalesHeader);
ScribePublisher.PublishModification(RecRef,xRecRef);
// ***** SCRIBE ENDS *****

16. 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.

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

Dynamics NAV Adapter Version - 86 -


3.1.1
Editing the codeunits — Dynamics NAV 2016

Editing The Codeunits — Dynamics NAV


2016
For Dynamics NAV to work with Scribe Insight, you must modify the codeunits for each
targeted database to:

l Provide the entry point for Scribe’s NAS-based custom logic


l Allow Scribe to publish updates, inserts, and deletes from the database
The steps to add the Scribe changes to the codeunits vary depending on whether your
codeunits have been modified.

If the codeunits have been modified, or if you do not know whether they have
been modified, Scribe suggests manually editing each codeunit file, as
described below, to preserve any previous changes.

Making The Scribe Changes To A Modified Codeunit


If the codeunit has been modified, edit the codeunit to add the Scribe code changes while
preserving any modifications that have already been made to codeunit.

Your Dynamics NAV license must have appropriate permissions to open the


C/AL editor. For information, see your Dynamics NAV Administrator.

No changes are required for codeunit 86 for adapters for Dynamics NAV 2013
R2, Dynamics NAV 2015, and Dynamics NAV 2016.

Making The Scribe Changes To An Unmodified Codeunit


If you are sure that the codeunit does not contain any non-Scribe modifications and you are
running a Dynamics NAV W1 system, you can import the W1.9.00.42815.fob to update all of
the codeunits with Scribe modifications. These codeunits replace the standard codeunits but
contain a number of Scribe-specific changes.

Dynamics NAV Adapter Version - 87 -


3.1.1
Editing codeunit 1 — Dynamics NAV 2016

Editing Codeunit 1 — Dynamics NAV


2016
If codeunit 1 has been modified, add the appropriate Scribe 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\90\Service\Add-Ins\Scribe\ScribeModifications\W1.9.00.42815.

To edit the codeunit, use the .txt file that matches your version of Dynamics NAV. Scribe
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 ( ).
4. From the list of codeunits, select codeunit 1, ApplicationManagement at the top of
the list.
5. Click Design to open the C/AL Editor.
6. After it is open, click anywhere in the codeunit design.
7. On the Microsoft Dynamics NAV 2016 Development Environment View menu, click
C/AL Globals.
8. On the Functions tab, select the GetDatabaseTableTriggerSetup global trigger
function, then click Locals.
9. On the Variables tab, create a ScribePublisher variable as noted below, then close
this window.
Global trigger functions must have these local variables.

Name DataType Subtype Length


ScribePublisher Codeunit Scribe Publisher

10. 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:
l OnDatabaseInsert
l OnDatabaseModify
l OnDatabaseDelete
l OnDatabaseRename

Dynamics NAV Adapter Version - 88 -


3.1.1
Editing codeunit 1 — Dynamics NAV 2016

11. On the Functions tab, create a new function titled NASHandler:


l In C/AL Locals of NASHandler:
o Add the following parameter

Name DataType Subtype Length


o NASID Text 260

o Add the following variables:

Name DataType Subtype Length


Parameter Text 260
ParamStr Text 260
SepPosition Integer

l Select the NASHandler function, click View > Properties, and set Local to
No.
l
In the NASHandler function, add the following lines:

ParamStr := UPPERCASE(NASID);
REPEAT
  SepPosition := STRPOS(ParamStr,',');
  IF SepPosition > 0 THEN
    Parameter := COPYSTR(ParamStr,1,SepPosition - 1)
  ELSE
    Parameter := ParamStr;
  CASE Parameter OF
    'JOBQUEUE':
    CODEUNIT.RUN(CODEUNIT::"Job Queue - NAS Start Up");
    //*****SCRIBE BEGINS*****
    'SCRIBE':
    CODEUNIT.RUN(CODEUNIT::"Scribe Adapter Hooks");
    //*****SCRIBE ENDS*****
  END;
  ParamStr := COPYSTR(ParamStr,SepPosition + 1);
  UNTIL SepPosition = 0;

12. Close the C/AL Globals window to return to the C/AL Editor.
13. In codeunit 1 ApplicationManagement, edit the following global trigger functions:
l Trigger Function 1
GetDatabaseTableTriggerSetup(TableID: Integer; VAR OnDatabaseInsert:
Boolean; VAR OnDatabaseModify: Boolean; VAR OnDatabaseDelete: Boolean;
VAR OnDatabaseRename:Boolean)

After:

ChangeLogMgt.GetDatabaseTableTriggerSetup
(TableId,OnDatabaseInsert,OnDatabaseModify,
OnDatabaseDelete,OnDatabaseRename);

Dynamics NAV Adapter Version - 89 -


3.1.1
Editing codeunit 1 — Dynamics NAV 2016

IntegrationManagement.GetDatabaseTableTriggerSetup
(TableId,OnDatabaseInsert,OnDatabaseModify,
OnDatabaseDelete,OnDatabaseRename);

Add:

//****Scribe Begins *****


ScribePublisher.GetTableTriggerSetup(TableId,OnDatabaseInsert,
OnDatabaseModify,OnDatabaseDelete,OnDatabaseRename);
//****Scribe Ends *****

l Trigger Function 2
OnDatabaseInsert (RecRef : RecordRef)

After:

ChangeLogMgt.LogInsertion(RecRef);
IntegrationManagement.OnDatabaseInsert(RecRef);

Add: 

//****Scribe Begins *****


IF RecRef.GET(RecRef.RECORDID) THEN
ScribePublisher.PublishInsertion(RecRef);
//****Scribe Ends *****

This added statement prevents Inserts from being published,


reducing the clutter that may occur when creating records. For
example, Dynamics NAV counts an Insert as both an Insert and a
Modify for most entities and generates two messages. However,
this line also prevents some other entities, such as Sales Line,
from publishing Inserts.

If you require Inserts to be published, comment out the following


line from the added code:

IF RecRef.GET(RecRef.RECORDID) THEN

l Trigger Function 3
OnDatabaseModify (RecRef : RecordRef)

In the View menu, click C\AL locals.> Variables tab and enter:

Name DataType Subtype Length

publishUpdate Boolean

Before:

Dynamics NAV Adapter Version - 90 -


3.1.1
Editing codeunit 1 — Dynamics NAV 2016

ChangeLogMgt

Add:

// *****Scribe Begins*****
IF xRecRef.GET(RecRef.RECORDID) THEN
BEGIN
publishUpdate:=True
END;
//*****Scribe Ends*****

In the View menu, click C\AL locals.> Variables tab and enter:

Name DataType Subtype Length

xRecRef RecordRef

After:

ChangeLogMgt.LogModification(RecRef);
IntegrationManagement.OnDatabaseModify(RecRef);

Add:

//****Scribe Begins *****


if publishUpdate THEN
ScribePublisher.PublishModification(RecRef,xRecRef);
//****Scribe Ends *****

l Trigger Function 4
OnDatabaseDelete

After:

ChangeLogMgt.LogDeletion(RecRef);
IntegrationManagement.OnDatabaseDelete(RecRef);

Add:

//****Scribe Begins *****


IF RecRef.GET(RecRef.RECORDID) THEN
ScribePublisher.PublishDeletion(RecRef);
//****Scribe Ends *****

l Trigger Function 5
OnDatabaseRename (RecRef : RecordRef;xRecRef :

After:

ChangeLogMgt.LogRename(RecRef,xRecRef);
IntegrationManagement.OnDatabaseRename(RecRef,xRecRef);

Add:

Dynamics NAV Adapter Version - 91 -


3.1.1
Editing codeunit 1 — Dynamics NAV 2016

//****Scribe Begins *****


IF RecRef.GET(RecRef.RECORDID) THEN
ScribePublisher.PublishRename(RecRef,xRecRef);
//****Scribe Ends *****

14. 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.

In the Object Designer, in the Version List column, edit the


ApplicationManagement codeunit's version to reflect the new revision
level.

Dynamics NAV Adapter Version - 92 -


3.1.1
Editing codeunit 80 — Dynamics NAV 2016

Editing Codeunit 80 — Dynamics NAV


2016
If codeunit 80 has been modified, you must add the appropriate Scribe code changes to the
codeunit design. Carefully editing codeunit 80 can preserve any changes that have already
been made to it.

The file COD80.txt resides in the NAS working directory subfolder that holds the Dynamics
NAV localization, database version, and build, for example: ..\Microsoft Dynamics
NAV\90\Service\Add-Ins\Scribe\ScribeModifications\W1.9.00.42815.

To edit the codeunit, use the .txt file that matches your version of Microsoft Dynamics NAV.
Scribe suggests that you review COD80.txt before editing codeunit 80.

Correcting The Window Variable Error

When running the PostSalesOrder custom action which wraps Codeunit 80


Sales-Post, you may get an error message saying that you cannot use C/AL
variables of type DIALOG when running the Application Server. This error is
caused by the global variable Window used in OnRun trigger.

To Correct The Window Variable Error

Dynamics NAV C/AL code requires BEGIN and END keywords encapsulating
compound statements. Where the “IF GUIALLOWED THEN:” statement is
added, if there are multiple lines of C/AL Code invoking the Window variable,
then the BEGIN and END keywords must be used to encapsulate all of lines of
code.

Add the following statement before all instances of the Window variable in the
design of codeunit 80:
IF GUIALLOWEDTHEN

For example, for the following statement:

Window.UPDATE(1,STRSUBSTNO(Text007,"Document
type","No.",SalesInvHeader."No."));

Add IF GUIALLOWED THEN:

//*****Scribe Begins*****
//Hide GUI window in NAS
IF GUIALLOWED THEN
Window.UPDATE(1,STRSUBSTNO(Text007,"Document
type","No.",SalesInvHeader."No."));
//*****Scribe Ends*****

Dynamics NAV Adapter Version - 93 -


3.1.1
Editing codeunit 80 — Dynamics NAV 2016

This eliminates the error message when the NAS runs codeunit 80.

Making Other Changes To Codeunit 80


After you correct the Window variable error, make the remaining required edits to codeunit
80.

To Edit Codeunit 80

1. Open the Microsoft Dynamics NAV Development Environment.


2. Click Tools > Object Designer. The Object Designer appears.
3. Click Codeunit ( ).
4. From the list of codeunits, select codeunit 80, Sales-Post.
5. Click Design. The C/AL Editor appears.
6. Click anywhere in the OnRun section of the open codeunit.
7. On the Microsoft Dynamics NAV 2016 Development Environment, click View > C/AL
Locals.
8. On the Variables tab,add the following local variables:

Name DataType Subtype Length


ScribePublisher Codeunit Scribe Publisher
RecRef RecordRef

9. Close the C/AL Locals window. You return to the C/AL Editor.
10. Click View > C/AL Globals.
11. On the Variablestab, add the global variable:

Name DataType Subtype Length


CustLedgEntry Record Cust. Ledger Entry

12. Save and close C/AL Globals. You return to the C/AL Editor.
13. In the OnRun section:
After:

IF "Bal. Account No." <> '' THEN BEGIN:

Replace:

// Balancing account
IF "Bal. Account No." <> '' THEN BEGIN
Window.UPDATE(5,1);
IF NOT IsOnlinePayment(SalesHeader) THEN
PostBalancing(0)

With:

Dynamics NAV Adapter Version - 94 -


3.1.1
Editing codeunit 80 — Dynamics NAV 2016

// Balancing account
IF "Bal. Account No." <> '' THEN BEGIN
//*****SCRIBE BEGINS*****
//Hide GUI window in NAS
IF GUIALLOWED THEN
Window.UPDATE(5,1);
CustLedgEntry.FINDLAST;
GenJnlLine.INIT;
GenJnlLine."Posting Date" := "Posting Date";
GenJnlLine."Document Date" := "Document Date";
GenJnlLine.Description := "Posting Description";
GenJnlLine."Shortcut Dimension 1 Code" := "Shortcut Dimension 1 Code";
GenJnlLine."Shortcut Dimension 2 Code" := "Shortcut Dimension 2 Code";
GenJnlLine."Reason Code" := "Reason Code";
GenJnlLine."Account Type" := GenJnlLine."Account Type"::Customer;
GenJnlLine."Account No." := "Bill-to Customer No.";
IF "Document Type" = "Document Type"::"Credit Memo" THEN
GenJnlLine."Document Type" := GenJnlLine."Document Type"::Refund
ELSE
GenJnlLine."Document Type" := GenJnlLine."Document Type"::Payment;
GenJnlLine."Document No." := GenJnlLineDocNo;
GenJnlLine."External Document No." := GenJnlLineExtDocNo;
IF "Bal. Account Type" = "Bal. Account Type"::"Bank Account" THEN
GenJnlLine."Bal. Account Type" := GenJnlLine."Bal. Account Type"::"Bank
Account";
GenJnlLine."Bal. Account No." := "Bal. Account No.";
GenJnlLine."Currency Code" := "Currency Code";
GenJnlLine.Amount :=
TotalSalesLine."Amount Including VAT" + CustLedgEntry."Remaining Pmt. Disc.
Possible";
GenJnlLine."Source Currency Code" := "Currency Code";
GenJnlLine."Source Currency Amount" := GenJnlLine.Amount;
GenJnlLine.Correction := Correction;
CustLedgEntry.CALCFIELDS(Amount);
IF CustLedgEntry.Amount = 0 THEN
GenJnlLine."Amount (LCY)" := TotalSalesLineLCY."Amount Including VAT"
ELSE
GenJnlLine."Amount (LCY)" :=
TotalSalesLineLCY."Amount Including VAT" + ROUND(
CustLedgEntry."Remaining Pmt. Disc. Possible" /
CustLedgEntry."Adjusted Currency Factor");
IF SalesHeader."Currency Code" = '' THEN
GenJnlLine."Currency Factor" := 1
ELSE
GenJnlLine."Currency Factor" := SalesHeader."Currency Factor";
GenJnlLine."Applies-to Doc. Type" := GenJnlLineDocType;
GenJnlLine."Applies-to Doc. No." := GenJnlLineDocNo;
GenJnlLine."Source Type" := GenJnlLine."Source Type"::Customer;
GenJnlLine."Source No." := "Bill-to Customer No.";
GenJnlLine."Source Code" := SrcCode;
GenJnlLine."Posting No. Series" := "Posting No. Series";
GenJnlLine."IC Partner Code" := "Sell-to IC Partner Code";

Dynamics NAV Adapter Version - 95 -


3.1.1
Editing codeunit 80 — Dynamics NAV 2016

GenJnlLine."Allow Zero-Amount Posting" := TRUE;


GenJnlPostLine.RunWithCheck(GenJnlLine);
//*****Scribe Ends*****

14. 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.

Dynamics NAV Adapter Version - 96 -


3.1.1
Editing codeunit 414 — Dynamics NAV 2016

Editing Codeunit 414 — Dynamics NAV


2016
If codeunit 414 has been modified, add the appropriate Scribe code changes to the codeunit
design. Carefully editing codeunit 1 can preserve any changes that have already been made
to it.

The file COD414.txt resides in the NAS working directory subfolder that holds the
Dynamics NAV localization, database version, and build, for example: ..\Microsoft
Dynamics NAV\90\Service\Add-Ins\Scribe\ScribeModifications\W1.9.00.42815.

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

To Edit Codeunit 414

1. Open the Microsoft Dynamics NAV Development Environment.


2. Click Tools > Object Designer. The Object Designer appears.
3. Click Codeunit ( ).
4. From the list of codeunits, select codeunit 414, Release Sales Document.
5. Click Design to open the C/AL Editor.
6. Click anywhere in the OnRun section of the open codeunit.
7. On Microsoft Dynamics NAV 2016 Development Environment View menu, click C/AL
Locals.
8. On the Variables tab, add the following local variables:

Name DataType Subtype Length


ScribePublisher Codeunit Scribe Publisher
RecRef RecordRef
xRecRef RecordRef

9. Close the C/AL Locals window to return to the C/AL Editor.


10. In the OnRun section:
After:

IF Status = Status::Released THEN EXIT;

Add:

// ***** SCRIBE BEGINS *****


// Get the RecordRef of the original record
xRecRef.GETTABLE(Rec);
// ***** SCRIBE ENDS *****

Dynamics NAV Adapter Version - 97 -


3.1.1
Editing codeunit 414 — Dynamics NAV 2016

11. At the end of the OnRun section just before the Reopen section begins:
Add:

// ***** SCRIBE BEGINS *****


// Trigger the Scribe Publisher
RecRef.GETTABLE(Rec);
ScribePublisher.PublishModification(RecRef,xRecRef);
// ***** SCRIBE ENDS *****

12. In the C/AL Editor, click in the Reopen section of the codeunit, then open the C/AL
Locals window.
13. Click the Variables tab, then add the following variables:

Name DataType Subtype Length


ScribePublisher Codeunit Scribe Publisher
RecRef RecordRef
xRecRef RecordRef

14. Close the C/AL Locals window to return to the C/AL Editor.
15. In the Reopen section:
After: 

IF Status = Status::Open THEN EXIT;

Add:

// ***** SCRIBE BEGINS *****


// Get RecordRef of the original record
xRecRef.GETTABLE(SalesHeader);
// ***** SCRIBE ENDS *****

After: 

WhseSalesRelease.Reopen(SalesHeader);

Add:

// ***** SCRIBE BEGINS *****


RecRef.GETTABLE(SalesHeader);
ScribePublisher.PublishModification(RecRef,xRecRef);
// ***** SCRIBE ENDS *****

16. 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.

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

Dynamics NAV Adapter Version - 98 -


3.1.1
Editing the codeunits — Dynamics NAV 2017

Editing The Codeunits — Dynamics NAV


2017
For Dynamics NAV to work with Scribe Insight, you must modify the codeunits for each
targeted database to:

l Provide the entry point for Scribe’s NAS-based custom logic


l Allow Scribe to publish updates, inserts, and deletes from the database
The steps to add the Scribe changes to the codeunits vary depending on whether your
codeunits have been modified.

If the codeunits have been modified, or if you do not know whether they have
been modified, Scribe suggests manually editing each codeunit file, as
described below, to preserve any previous changes.

Making The Scribe Changes To A Modified Codeunit


If the codeunit has been modified, edit the codeunit to add the Scribe code changes while
preserving any modifications that have already been made to codeunit.

Your Dynamics NAV license must have appropriate permissions to open the


C/AL editor. For information, see your Dynamics NAV Administrator.

No changes are required for codeunit 86 for adapters for Dynamics NAV 2013
R2, Dynamics NAV 2015, Dynamics NAV 2016, and Dynamics NAV 2017.

Making The Scribe Changes To An Unmodified Codeunit


If you are sure that the codeunit does not contain any non-Scribe modifications and you are
running a Dynamics NAV W1 system, you can import the W1.10.0.13682.fob to update all of
the codeunits with Scribe modifications. These codeunits replace the standard codeunits but
contain a number of Scribe-specific changes.

Dynamics NAV Adapter Version - 99 -


3.1.1
Editing codeunit 1 — Dynamics NAV 2017

Editing Codeunit 1 — Dynamics NAV


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

If codeunit 1 has been modified, add the appropriate Scribe 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\100\Service\Add-Ins\Scribe\ScribeModifications\W1.10.0.13682.

To edit the codeunit, use the .txt file that matches your version of Dynamics NAV. Scribe
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 ( ).
4. From the list of codeunits, select codeunit 1, ApplicationManagement at the top of
the list.
5. Click Design to open the C/AL Editor.
6. After it is open, click anywhere in the codeunit design.
7. On the Microsoft Dynamics NAV 2017 Development Environment View menu, click
C/AL Globals.
8. On the Functions tab, select the GetDatabaseTableTriggerSetup global trigger
function, then click Locals.
9. On the Variables tab, create a ScribePublisher variable as noted below, then close
this window.
Global trigger functions must have these local variables.

Name DataType Subtype Length


ScribePublisher Codeunit Scribe Publisher

10. 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:
l OnDatabaseInsert
l OnDatabaseModify

Dynamics NAV Adapter Version - 100 -


3.1.1
Editing codeunit 1 — Dynamics NAV 2017

l OnDatabaseDelete
l OnDatabaseRename
11. On the Functions tab, create a new function titled NASHandler:
l In C/AL Locals of NASHandler:
o Add the following parameter

Name DataType Subtype Length


o NASID Text 260

o Add the following variables:

Name DataType Subtype Length


Parameter Text 260
ParamStr Text 260
SepPosition Integer

l Select the NASHandler function, click View > Properties, and set Local to
No.
l
In the NASHandler function, add the following lines:

NASHandler(NASID : Text[260])
ParamStr := UPPERCASE(NASID);
REPEAT

SepPosition := STRPOS(ParamStr,',');
IF SepPosition > 0 THEN
Parameter := COPYSTR(ParamStr,1,SepPosition - 1)
ELSE
Parameter := ParamStr;

CASE Parameter OF
'JOBQUEUE':
CODEUNIT.RUN(CODEUNIT::"Job Queue Start Codeunit");
//*****SCRIBE BEGINS*****
'SCRIBE':
CODEUNIT.RUN(CODEUNIT::"Scribe Adapter Hooks");
//*****SCRIBE ENDS*****

END;

Dynamics NAV Adapter Version - 101 -


3.1.1
Editing codeunit 1 — Dynamics NAV 2017

ParamStr := COPYSTR(ParamStr,SepPosition + 1);


UNTIL SepPosition = 0;

12. Close the C/AL Globals window to return to the C/AL Editor.
13. In codeunit 1 ApplicationManagement, edit the following global trigger functions:
l Trigger Function 1
GetDatabaseTableTriggerSetup(TableID: Integer; VAR OnDatabaseInsert:
Boolean; VAR OnDatabaseModify: Boolean; VAR OnDatabaseDelete: Boolean;
VAR OnDatabaseRename:Boolean)

After:

ChangeLogMgt.GetDatabaseTableTriggerSetup
(TableId,OnDatabaseInsert,OnDatabaseModify,
OnDatabaseDelete,OnDatabaseRename);
IntegrationManagement.GetDatabaseTableTriggerSetup
(TableId,OnDatabaseInsert,OnDatabaseModify,
OnDatabaseDelete,OnDatabaseRename);

Add:

//****Scribe Begins *****


ScribePublisher.GetTableTriggerSetup(TableId,OnDatabaseInsert,
OnDatabaseModify,OnDatabaseDelete,OnDatabaseRename);
//****Scribe Ends *****

l Trigger Function 2
OnDatabaseInsert (RecRef : RecordRef)

After:

ChangeLogMgt.LogInsertion(RecRef);
IntegrationManagement.OnDatabaseInsert(RecRef);

Add: 

//****Scribe Begins *****


IF RecRef.GET(RecRef.RECORDID) THEN
ScribePublisher.PublishInsertion(RecRef);
//****Scribe Ends *****

Dynamics NAV Adapter Version - 102 -


3.1.1
Editing codeunit 1 — Dynamics NAV 2017

This added statement prevents Inserts from being published,


reducing the clutter that may occur when creating records. For
example, Dynamics NAV counts an Insert as both an Insert and a
Modify for most entities and generates two messages. However,
this line also prevents some other entities, such as Sales Line,
from publishing Inserts.

If you require Inserts to be published, comment out the following


line from the added code:

IF RecRef.GET(RecRef.RECORDID) THEN

l Trigger Function 3
OnDatabaseModify (RecRef : RecordRef)

In the View menu, click C\AL locals.> Variables tab and enter:

Name DataType Subtype Length

publishUpdate Boolean

Before:

ChangeLogMgt

Add:

// *****Scribe Begins*****
IF xRecRef.GET(RecRef.RECORDID) THEN
BEGIN
publishUpdate:=True
END;
//*****Scribe Ends*****

In the View menu, click C\AL locals.> Variables tab and enter:

Name DataType Subtype Length

xRecRef RecordRef

After:

ChangeLogMgt.LogModification(RecRef);
IntegrationManagement.OnDatabaseModify(RecRef);

Add:

Dynamics NAV Adapter Version - 103 -


3.1.1
Editing codeunit 1 — Dynamics NAV 2017

//****Scribe Begins *****


if publishUpdate THEN
ScribePublisher.PublishModification(RecRef,xRecRef);
//****Scribe Ends *****

l Trigger Function 4
OnDatabaseDelete

After:

ChangeLogMgt.LogDeletion(RecRef);
IntegrationManagement.OnDatabaseDelete(RecRef);

Add:

//****Scribe Begins *****


IF RecRef.GET(RecRef.RECORDID) THEN
ScribePublisher.PublishDeletion(RecRef);
//****Scribe Ends *****

l Trigger Function 5
OnDatabaseRename (RecRef : RecordRef;xRecRef :

After:

ChangeLogMgt.LogRename(RecRef,xRecRef);
IntegrationManagement.OnDatabaseRename(RecRef,xRecRef);

Add:

//****Scribe Begins *****


IF RecRef.GET(RecRef.RECORDID) THEN
ScribePublisher.PublishRename(RecRef,xRecRef);
//****Scribe Ends *****

14. 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.

In the Object Designer, in the Version List column, edit the


ApplicationManagement codeunit's version to reflect the new revision
level.

Dynamics NAV Adapter Version - 104 -


3.1.1
Editing codeunit 80 — Dynamics NAV 2017

Editing Codeunit 80 — Dynamics NAV


2017
Scribe codeunit modifications cause the Window variable to be invoked only when the GUI
is allowed to prevent issues when running Scribe integrations. Additional modifications
publish the insertion of Sales objects.

If codeunit 80 has been modified, you must add the appropriate Scribe code changes to the
codeunit design. Carefully editing codeunit 80 can preserve any changes that have already
been made to it.

The file COD80.txt resides in the NAS working directory subfolder that holds the Dynamics
NAV localization, database version, and build, for example: ..\Microsoft Dynamics
NAV\100\Service\Add-Ins\Scribe\ScribeModifications\W1.10.0.13682.

To edit the codeunit, use the .txt file that matches your version of Microsoft Dynamics NAV.
Scribe suggests that you review COD80.txt before editing codeunit 80.

Correcting The Window Variable Error

When running the PostSalesOrder custom action which wraps Codeunit 80


Sales-Post, you may get an error message saying that you cannot use C/AL
variables of type DIALOG when running the Application Server. This error is
caused by the global variable Window used in OnRun trigger.

To Correct The Window Variable Error

Dynamics NAV C/AL code requires BEGIN and END keywords encapsulating
compound statements. Where the “IF GUIALLOWED THEN:” statement is
added, if there are multiple lines of C/AL Code invoking the Window variable,
then the BEGIN and END keywords must be used to encapsulate all of lines of
code.

Add the following statement before all instances of the Window variable in the
design of codeunit 80:
IF GUIALLOWEDTHEN

For example, for the following statement:

Window.UPDATE(1,STRSUBSTNO(Text007,"Document
type","No.",SalesInvHeader."No."));

Add IF GUIALLOWED THEN:

Dynamics NAV Adapter Version - 105 -


3.1.1
Editing codeunit 80 — Dynamics NAV 2017

//*****Scribe Begins*****
//Hide GUI window in NAS
IF GUIALLOWED THEN
Window.UPDATE(1,STRSUBSTNO(Text007,"Document
type","No.",SalesInvHeader."No."));
//*****Scribe Ends*****

This eliminates the error message when the NAS runs codeunit 80.

Making Other Changes To Codeunit 80


After you correct the Window variable error, make the remaining required edits to codeunit
80.

To Edit Codeunit 80

1. Open the Microsoft Dynamics NAV Development Environment.


2. Click Tools > Object Designer. The Object Designer appears.
3. Click Codeunit ( ).
4. From the list of codeunits, select codeunit 80, Sales-Post.
5. Click Design. The C/AL Editor appears.
6. Click anywhere in the OnRun section of the open codeunit.
7. On the Microsoft Dynamics NAV 2017 Development Environment, click View > C/AL
Locals.
8. On the Variables tab,add the following local variables:

Name DataType Subtype Length


ScribePublisher Codeunit Scribe Publisher
RecRef RecordRef

9. Close the C/AL Locals window. You return to the C/AL Editor.
10. Click View > C/AL Globals.
11. On the Variablestab, add the global variable:

Name DataType Subtype Length


CustLedgEntry Record Cust. Ledger Entry

12. Save and close C/AL Globals. You return to the C/AL Editor.
13. In the OnRun section:
After:

IF NOT SalesHeader.IsCreditDocType THEN BEGIN

Add:

Dynamics NAV Adapter Version - 106 -


3.1.1
Editing codeunit 80 — Dynamics NAV 2017

//*****Scribe Begins*****
// Trigger ScribePublisher
RecRef.GETTABLE(SalesInvHeader);
ScribePublisher.PublishInsertion(RecRef);
//*****Scribe Ends*****

14. 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.

Dynamics NAV Adapter Version - 107 -


3.1.1
Editing codeunit 414 — Dynamics NAV 2017

Editing Codeunit 414 — Dynamics NAV


2017
Scribe codeunit modifications allow publishing of modifications of Sales headers to Scribe.

If codeunit 414 has been modified, add the appropriate Scribe code changes to the codeunit
design. Carefully editing codeunit 1 can preserve any changes that have already been made
to it.

The file COD414.txt resides in the NAS working directory subfolder that holds the
Dynamics NAV localization, database version, and build, for example: ..\Microsoft
Dynamics NAV\100\Service\Add-Ins\Scribe\ScribeModifications\W1.10.0.13682.

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

To Edit Codeunit 414

1. Open the Microsoft Dynamics NAV Development Environment.


2. Click Tools > Object Designer. The Object Designer appears.
3. Click Codeunit ( ).
4. From the list of codeunits, select codeunit 414, Release Sales Document.
5. Click Design to open the C/AL Editor.
6. Click anywhere in the LinesWereModified section of the open codeunit.
7. On Microsoft Dynamics NAV Development Environment View menu, click C/AL
Locals.
8. On the Variables tab, add the following local variables:

Name DataType Subtype Length


ScribePublisher Codeunit Scribe Publisher
RecRef RecordRef
xRecRef RecordRef

9. Close the C/AL Locals window to return to the C/AL Editor.


10. In the LinesWereModified section:
After:

IF Status = Status::Released THEN


EXIT;

Add:

Dynamics NAV Adapter Version - 108 -


3.1.1
Editing codeunit 414 — Dynamics NAV 2017

// ***** SCRIBE BEGINS *****


// Get the RecordRef of the original record
xRecRef.GETTABLE(Rec);
// ***** SCRIBE ENDS *****

11. At the end of the LinesWereModified section just before the Reopen section begins:

Add:

// ***** SCRIBE BEGINS *****


// Trigger the Scribe Publisher
RecRef.GETTABLE(Rec);
ScribePublisher.PublishModification(RecRef,xRecRef);
// ***** SCRIBE ENDS *****

12. In the C/AL Editor, click in the Reopen section of the codeunit, then open the C/AL
Locals window.
13. Click the Variables tab, then add the following variables:

Name DataType Subtype Length


ScribePublisher Codeunit Scribe Publisher
RecRef RecordRef
xRecRef RecordRef

14. Close the C/AL Locals window to return to the C/AL Editor.
15. In the Reopen section:
After: 

IF Status = Status::Open THEN EXIT;

Add:

// ***** SCRIBE BEGINS *****


// Get RecordRef of the original record
xRecRef.GETTABLE(SalesHeader);
// ***** SCRIBE ENDS *****

After: 

WhseSalesRelease.Reopen(SalesHeader);

Add:

// ***** SCRIBE BEGINS *****


RecRef.GETTABLE(SalesHeader);
ScribePublisher.PublishModification(RecRef,xRecRef);
// ***** SCRIBE ENDS *****

16. 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.

Dynamics NAV Adapter Version - 109 -


3.1.1
Editing codeunit 414 — Dynamics NAV 2017

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

Dynamics NAV Adapter Version - 110 -


3.1.1
Activating The Scribe Actions

Activating The Scribe Actions


The Scribe Adapter for Dynamics NAV accesses the information in Dynamics NAV via NAS.
This mechanism allows for reading information about tables and their content, but not the
information about codeunits and their properties.

The custom information used as custom actions must be placed in Dynamics NAV tables so
that Scribe Insight can access this information. Therefore, the following tables have been
created in Microsoft Dynamics NAV to contain data about codeunits, that is, custom actions,
and the parameters required to run these actions:

1. Table 14094200 Scribe Custom Actions


2. Table 14094201 Scribe Action Parameters
After importing the Common<XXXX>.fob file, these two tables are empty. You need to
fill the tables with the data about codeunits and their parameters.

To Populate The Custom Action Tables

1. Launch the Microsoft Dynamics NAV Development Environment.


2. Click Tools > Object Designer. The Object Designer appears.
3. Click Codeunit and scroll to the Scribe Create Default Actions codeunit
(14094200).
4. Select this codeunit, then click Run.

If you are prompted to connect to your company before the Dynamics


NAV client opens, click OK.

5. If you are prompted to overwrite your current custom actions, click Yes.
These tables are populated and you can view/select the Scribe Custom actions under
the Adapter for Dynamics NAV Data Objects and Stored Procedures.

Dynamics NAV Adapter Version - 111 -


3.1.1
Importing Default Validation Rules

Importing Default Validation Rules


Validation rules allow Scribe to manage the business logic for entities that Scribe requires.
These rules are defined in the Scribe Validation Rules table in Dynamics NAV and applied to
the data that is received by Dynamics NAV.

Scribe provides a set of commonly used validation rules in the ScribeValidationRules.txt


file, which is included in the Scribe Adapter for Dynamics NAV installation directory.

Importing default validation rules varies by version of Dynamics NAV. Click the link for
your version to view step-by-step instructions.

l Dynamics NAV 2013 Or Higher


l Dynamics NAV 2009 R2

Import Into Dynamics NAV 2013 Or Higher


1. From Dynamics NAV, open the Object designer.
2. Select XMLPort, then scroll down and select Scribe Validation Rules Imp/Ex
from the list:

3. Click Run to populate the Scribe Validation Rules table. The Edit - Scribe Validation
Rules client window opens to allow you to import or export the table. Make sure
Import is selected and click OK.
4. From the Import window, browse to the directory that contains the
ScribeValidationRules.txt file. The default location is ..\Microsoft Dynamics
NAV\<xx>\Service\Add-

Dynamics NAV Adapter Version - 112 -


3.1.1
Importing Default Validation Rules

Ins\Scribe\ScribeModifications\Common<year>\, where <xx> is the


Dynamics NAV installation folder, which varies by Dynamics NAV version, and
<year> is the Dynamics NAV version, such as 2013 or 2016.
5. Select the ScribeValidationRules.txt file and click OK. The Validation Rules table is
imported and can be viewed from a Dynamics NAV 2013 client window.

To View Or Edit The Validation Rules

1. Select Table from the Object Designer.


2. Select Scribe Validation Rules from the list of available tables.
3. Click Run. The Scribe Validation Rules table opens in a client window. From here, you
can view or edit the table. See the Microsoft Dynamics NAV help for information.

Import Into Dynamics NAV 2009 R2


1. On the Navigation pane, click the Scribe Integration navigation button.
2. Under Setup, click Import / Export Validation Rules. The Scribe Validation Rules
Import dialog box appears.
3. In the File Name field, click the browse button to locate the validation setup file. The
Dataport Import File Name dialog box appears.

The default validation setup file is located under the following path:
..\Microsoft Dynamics
NAV\60\ApplicationServer\ScribeModifications\Common.

4. Select the ScribeValidationRules.txt file, then click Open.


5. For the Direction, verify that the Import option button is selected, then click OK.

If any modifications are made to the default validation setup imported


from file, the changed setup data can be exported for further use.

6. Click Yes to overwrite validation rules.


You can view the results of validation rules import in the Scribe Validation Rules window
located under Scribe Integration > Administration > Validation Rules.

Dynamics NAV Adapter Version - 113 -


3.1.1
Field-Level Validation

Field-Level Validation
To support the flexible nature of Microsoft Dynamics NAV, the Scribe Adapter for Dynamics
NAV lets you define how field-level validation should occur. These field-level validation
options are defined in the Dynamics NAV database.

By default, the Scribe Adapter for Dynamics NAV validates information before the records
are inserted or updated. However, the Dynamics NAV adapter does not call OnValidate()
for each field in every table. Include support for field-level validation by adding entries to a
settings table.

A file containing default validation setup is available as part of the Scribe


Adapter for Dynamics NAV. Typically, it can be imported from the following
location: C:\Program Files\Microsoft Dynamics
NAV\ApplicationServer\ScribeModifications\Common. If any
modifications are made to the default validation setup imported from file, the
changed setup data can be exported for further use.

To Define Field-level Validation

1. In the Microsoft Dynamics NAV client, click the Scribe Integration navigation
button.
2. Under Administration, click Validation Rules.
3. Edit the records in the ScribeValidation Rules form to reflect your field-level
validation choices.

Integrating data into a Microsoft Dynamics NAV object that is not


explicitly listed in the Scribe Validation Rules table generates an
exception. Any object you want to integrate with must be listed in this
table.

Validation Rules

l Each row in the Scribe Validation Rules form represents a single Microsoft
Dynamics NAV table for which you can set the field-level validation.
l Each column in the Scribe Validation Rules form represents the options and
settings defining how field-level validation is performed.

Column Name
Option Description
Table Name
Table Name NAV table whose behavior is being modified. Either type or select
from the list of the Table Objects the name of the table to be
used.

Dynamics NAV Adapter Version - 114 -


3.1.1
Field-Level Validation

Column Name
Option Description
Operation
Operation Operation that invokes the custom validation behavior. Choose
Insert, Modify, or InsertAndModify.

Two rows can be added to a table if different validation logic is


required for inserts and modifications.

Validation Mode
None Perform no field-level validation. This is the default. Select this
option to revert the associated table listed in Table Name back to
the default behavior without having to remove the listing from
the Scribe Validation Rules table.
Validate Call OnValidate() for applicable fields before updating or inserting
the record into the table.
InsertValidateUpdate Behavior differs for Insert and Update operations:

l Insert — Insert the record, call OnValidate() for


applicable fields, then update the record with the
finalized values.
l Update — Call OnValidate() for applicable fields,
then update the record.
This mode is intended for a record that needs to be inserted into
its Microsoft Dynamics NAV table before field-level validation
occurs. The inserted record needs to be updated with any new
values.

Objects that autocalculate IDs are common candidates for this


type of validation. For example, a record has to be inserted to
receive an auto-calculated ID, then other fields can be validated
and the initially inserted record can be updated as appropriate.

Fields To Validate
SetFields Only invoke the OnValidate() method associated with the fields
that are set by Scribe.

NormalFields Only invoke the OnValidate() method associated with ”normal”


fields, whether set by Scribe or not. This option does not include
atypical fields, such as flow fields.
AllFields Invoke the OnValidate() method for all fields, including flow fields.

Field Order Override


Field Order Override Optional, only validate fields whose field Ds are listed in this
comma-separated list. Fields are listed in the order in which they
should be validated. Either type or select from the Field List the

Dynamics NAV Adapter Version - 115 -


3.1.1
Field-Level Validation

Column Name
Option Description

numbers of the fields to be used.

The maximum size is 250 characters. For field lists that are
longer than 250 characters, use this field with the Field Order
Override 2 field.

The Fields To Validate rule is still honored within the list. When
combined with the SetFields option, only those fields listed and
set by Scribe are validated.

To override the ValidationMode, specify operations in the


validation with:

l "I" — INSERT
l "U" — UPDATE
l "OP" — INSERT on inserts or UPDATE on updates

For example:

l "1, 5, 3" — When validating the fields according to


the specified ValidationMode value, validate the
first field, validate the fifth field, then validate the
third field.
l "1, I, 5, 3, U" — Validate the first field, insert the
record into the object, validate the fifth field,
validate the third field, then update the associated
record.
l "1, 5, 3, OP" — Validate the first field, validate the
fifth field, validate the third field, then insert or
update the record, depending on the original
operation.

Field Order Override 2


Field Order Override 2 An expansion of the Field Order Override field for lists that exceed
250 characters. Use this if you need additional space for field IDs
to validate.

If the list in the Field Order Overrride field ends with a Field ID or
letter (such as I or U), the list in this field must start with a
comma.

Dynamics NAV Adapter Version - 116 -


3.1.1
Installing the Adapter for Dynamics NAV

Installing The Adapter For Dynamics


NAV
When a new version of Scribe Insight is released, the adapter updates included in that
release are installed from the Scribe Insight Installer. When an adapter release occurs
between Scribe Insight releases, the adapter updates included in that release are installed
from the Scribe Insight and Adapters Downloads page. Before installing an adapter, check
the Scribe Insight and Adapters Downloads page to determine whether you need to install
the adapter from within Scribe Insight or using the Adapter installation file from on the
Product Downloads page. For Dynamics NAV 3.1.1, the installation media is available on
the Product Downloads page.

Before installing the Scribe Adapter for Dynamics NAV:

You must install the correct Dynamics NAV NAS component for your version
of Dynamics NAV first. For more information, see Installing The NAS
Components.

1. Keep in mind that you need to install the Scribe Adapter for Dynamics NAV on the
Scribe server and on all computers or workstations that will be connecting to the
adapter.
2. Open and read the Release Notes for the Adapter for Dynamics NAV. You can find
these documents in the Scribe Success Community.
3. Make sure you have connectivity between the Scribe Server and the NAS Server.
4. Determine how to install the adapter, either by using the Scribe Setup Wizard, or
from the Scribe Downloads page. The Dynamics NAV 3.1.1 adapter install media is
only available from the Scribe Downloads page.
The steps for retrieving the Dynamics NAV installation packages differ, depending on
whether this adapter is released as part of an Insight release or in an adapter-only
release.

l Scribe Insight Release


l Adapter-Only Release

Scribe Insight Release


1. If the Scribe Setup Wizard is not running, from the Scribe Insight folder, run
Setup.exe.
2. Select Insight Adapters and click Start Installation. The Adapter Installation
window displays after Scribe is installed.
3. Select the adapter(s) you want to install. Make sure to select the adapter that
matches your version of Dynamics NAV.
4. Click OK.

Dynamics NAV Adapter Version - 117 -


3.1.1
Installing the Adapter for Dynamics NAV

5. Follow the instructions for the Setup Wizard for each adapter.
6. When you have finished, click Exit to close the Scribe Insight Setup Wizard.

When you restart the Scribe Workbench, you may be prompted to


register your Scribe adapter, depending on your licensing. Click Help >
Upgrade License. Either copy/paste or enter the adapter unlock code
you received from the Scribe Registration Service.

Adapter-Only Release

You must be a member of the local administrators group on the machines


where you run ScribeAdapterForMicrosoftDynamicsNAV.msi to install
the Dynamics NAV adapter and server.

1. If you have already downloaded and extracted the installation package, go to Step 5.
2. On the Scribe and Adapters Downloads page, under Scribe Adapter for Dynamics
NAV, click Installer. The File Download dialog box opens.
3. Click Save. Save the ScribeAdapterForMicrosoftDynamicsNAV.exe file on the
machine where your Scribe Insight server is installed.
4. In the Downloads directory, click ScribeAdapterForMicrosoftDynamicsNAV.exe.
The self-extracting zip file opens and unzips the following installation packages to
C:\ScribeAdapterForMicrosoftDynamicsNAV:
l ScribeAdapterForMicrosoftDynamicsNAV.msi — Scribe Adapter for
Dynamics NAV Version 3.1.1. Install this package on your Insight server.
l Version-specific NAS installation packages::
o ScribeAdapterForMicrosoftDynamicsNAV2009NAS.msi
o ScribeAdapterForMicrosoftDynamicsNAV2013NAS_Service.msi
o ScribeAdapterForMicrosoftDynamicsNAV2013_R2_NAS_Service.msi
o ScribeAdapterForMicrosoftDynamicsNAV2015NAS_Service.msi
o ScribeAdapterForMicrosoftDynamicsNAV2016NAS_Service.msi
o ScribeAdapterForMicrosoftDynamicsNAV2017NAS_Service.msi
Ignore the version-specific NAS files. These are used in the Installing The NAS
Components process.

5. Save the ScribeAdapterForMicrosoftDynamicsNAV.msi file to the Scribe Insight


Adapters directory, ..\ScribeInsight792_x64\Adapters or ..\ScribeInsight792_
x32\Adapters.
6. Double-click the ScribeAdapterForMicrosoftDynamicsNAV.msi file. The adapter
installation wizard opens.

Dynamics NAV Adapter Version - 118 -


3.1.1
Installing the Adapter for Dynamics NAV

7. Follow the directions in the wizard, then click Finish.

When you restart the Scribe Workbench, you may be prompted to


register your Scribe adapter, depending on your licensing. Click Help >
Upgrade License. Either copy/paste or enter the adapter unlock code
you received from the Scribe RegistrationService.

Dynamics NAV Adapter Version - 119 -


3.1.1
Connecting To The Adapter

Connecting To The Adapter


Set up the database connections before using Scribe Insight with the Scribe Adapter for
Dynamics NAV.

To Connect To The Adapter

1. Open the Scribe Workbench.


2. On the Scribe Workbench toolbar, click the Connections icon. The Connection
Manager dialog box appears.
3. Click New. The Add a Connection dialog box appears.
4. Expand the Adapters tree.
5. Click Microsoft Dynamics NAV, then click OK. The Login dialog box appears.
6. Choose or enter your connection settings:

Dynamics NAV 2013 And Higher Connection Settings

l Dynamics NAV 2009R2 — Disable this check box for Dynamics NAV versions


2013 and higher.
l Server Name — Name of the Database server.
l NAS Server Name — Name of the computer where NAS is installed, followed
by the port number if needed.

The default port number is 8085. If your company uses the default
port, you do not need to specify the port number.

If you are using a different port number, you must specify it. For

Dynamics NAV Adapter Version - 120 -


3.1.1
Connecting To The Adapter

example NAVTEST:8003. For more information about setting up


the NAS service and specifying the port, see Supporting Multiple
Organizations.

l Company — Name of Dynamics NAV company. This field is case-sensitive.


l User ID — Name of user or login name.
l Password — User's password.

Dynamics NAV 2009 R2 Connection Settings

l Dynamics NAV 2009R2 — Enable this check box only if your Dynamics


NAV version is 2009 R2.
l Server Type — Type of server you are using.
l Server Name — Name of the Database server.
l NAS Server Name — Name of the computer where NAS is installed, followed
by the port number if needed.

The default port number is 8085. If your company uses the default
port, you do not need to specify the port number.

If you are using a different port number, you must specify it. For
example NAVTEST:8003. For more information about setting up
the NAS service and specifying the port, see Supporting Multiple
Organizations.

l Database Name — Name of database.


l Company — Name of Dynamics NAV company. This field is case-sensitive.
l Authentication — Type of authentication you are using.

Dynamics NAV Adapter Version - 121 -


3.1.1
Connecting To The Adapter

l User ID — Name of user or login name. For Windows authentication include the
domain, such as domain\Username or [email protected].
l Password — User's password.
7. Click OK.
8. Close the Connection Manager dialog box.
9. On the Scribe Workbench toolbar, select either:
l Configure Source — Select Adapter for Microsoft Dynamics NAV from the
Connections list to connect using Microsoft Dynamics NAV as the source.
l Configure Steps — Select Adapter for Microsoft Dynamics NAV from the
Connections list to connect using Microsoft Dynamics NAV as the target.

Dynamics NAV Adapter Version - 122 -


3.1.1
Configuring the Publisher

Configuring The Publisher


The Scribe Publisher for Dynamics NAV publishes new and changed data to the ScribeIn
message queue as XML messages. These messages can be used as source data for Scribe
integration processes or forwarded to other non-Scribe processes. The Publisher for
Dynamics NAV is installed as part of the adapter installation.

Configure a publisher for each Dynamics NAV company instance from which you wish to
retrieve data. Once configured to support the integration, the publisher runs behind the
scenes, unnoticed; no configuration is necessary unless you change your integration
system architecture.

l Before you create the Publisher — You import the Common<XXX>.fob, which
creates the ScribePublisherSettings table, and you modify the installed code
units to update this table and communicate with the Publisher.
l When you create the Publisher — In the Scribe Insight Console, you create a
Publisher, which writes to the ScribePublisherSettings table all entities,
operations (such as insert, update, and delete), and any filter values you define.
Then, when an operation defined for your Publisher changes a record, that record is
updated in the ScribePublisherSettings table.
l When the Publisher runs — The Scribe NAV Publisher regularly polls the
ScribePublisherSettings table for record changes and, when changes are found,
filters those changes against the filter values you defined, retrieves changed
records that match that filter, and writes those changes as XML messages to the
PubIn queue. Then, the Publisher sends those messages from the PubIn queue to
the ScribeIn queue.

Dynamics NAV Adapter Version - 123 -


3.1.1
Setting The Publish As User

Setting The Publish As User


Setting up a Publish As user lets you designate a user as having modified a record, rather
than recognizing the user the DTS is connecting as.

Using the Publish As user lets you consolidate and publish a variety of changes as coming
from a single user while not publishing other types of changes from other users.

To Set The Publish As User

1. On the Scribe Workbench toolbar, click the Connections icon. The Connection
Manager dialog box appears.
2. Select Adapter for Microsoft Dynamics NAV, and click Edit. The Connection
Settings dialog box appears.
3. Click the DTS Connection Settings tab.
4. Click Adapter Settings.
5. On the General Settings tab, select the Publish As User check box.
6. Type or browse for the name of the user you want to designate as the Publish As
user.

The user connected as the Publish As user must have Dynamics NAV
SUPER privileges.

Dynamics NAV Adapter Version - 124 -


3.1.1
Setting Up The Publisher Process And Queues

Setting Up The Publisher Process And


Queues
If needed, set up a publisher process in the Scribe Console and create the publisher
message queues.

If you already have a working Publisher for Dynamics NAV, you can skip this
task.

The Publisher for Dynamics NAV is included as part of the Scribe Insight installation. For
more information, see the Scribe and Adapters Downloads page.

To Create A Publisher In The Scribe Console

1. In the Scribe Console, expand the Integration Server node and click Publishers and
Bridges.
2. Click Add.
3. In Step 1Publisher/Bridge Type, select Microsoft Dynamics NAV for
Publisher /Bridge type.
4. Define a name for the publisher in the Name box. The Creator and Server boxes are
populated automatically.
5. Click Step 4 Publisher/Bridge Properties. The Publisher for Microsoft Dynamics
NAV window is displayed.
6. Enter the connection information for your Microsoft Dynamics NAV server:

Dynamics NAV 2013 And Higher Connection Settings

Dynamics NAV Adapter Version - 125 -


3.1.1
Setting Up The Publisher Process And Queues

l Dynamics NAV 2009R2 — Disable this check box for Dynamics NAV versions


2013 and higher.
l Server Name — Name of the Database server.
l NAS Server Name — Name of the computer where NAS is installed, followed
by the port number if needed.

The default port number is 8085. If your company uses the default
port, you do not need to specify the port number.

If you are using a different port number, you must specify it. For
example NAVTEST:8003. For more information about setting up
the NAS service and specifying the port, see Supporting Multiple
Organizations.

l Company — Name of Dynamics NAV company. This field is case-sensitive.


l User ID — Name of user or login name.
l Password — User's password.

Dynamics NAV 2009 R2 Connection Settings

l Dynamics NAV 2009R2 — Enable this check box only if your Dynamics


NAV version is 2009 R2.
l Server Type — Type of server you are using.
l Server Name — Name of the Database server.
l NAS Server Name — Name of the computer where NAS is installed, followed
by the port number if needed.

Dynamics NAV Adapter Version - 126 -


3.1.1
Setting Up The Publisher Process And Queues

The default port number is 8085. If your company uses the default
port, you do not need to specify the port number.

If you are using a different port number, you must specify it. For
example NAVTEST:8003. For more information about setting up
the NAS service and specifying the port, see Supporting Multiple
Organizations.

l Database Name — Name of database.


l Company — Name of Dynamics NAV company. This field is case-sensitive.
l Authentication — Type of authentication you are using.
l User ID — Name of user or login name. For Windows authentication include the
domain, such as domain\Username or [email protected].
l Password — User's password.
When creating the publisher, three publisher message queues are created on your
Scribe server. The queue names use this format:
SCRIBESERVERNAME\Private$\NAVSERVERNAME_MSNAVPubIn.

When creating the publisher, three publisher message queues are created on your
Scribe server. The queue names use this format:
SCRIBESERVERNAME\Private$\NAVSERVERNAME_MSNAVPubIn.

For example, MYSCRIBESERVER\Private$\MYNAVSERVER_MSNAVPubIn.

7. Click the MSMQ button, and select the Log messages that were forwarded to
ScribeIn, ignored or filtered option.

Scribe recommends selecting this option while you are setting up the
publisher to assist with troubleshooting. Clear this setting after
verifying that the publisher is set up and working properly.

8. Click OK.
9. If you need to review the connection information, click Settings in Step 4
Publisher/Bridge Properties.
10. Click Step 5 Activation, and click Active.
11. Click Finish.

Troubleshooting Schema Errors


If the following error message appears when you try to create a DTS with an XML
connection, your XDR schema has duplicate node names: Invalid Schema or Document:
Node list not unique.

Dynamics NAV Adapter Version - 127 -


3.1.1
Setting Up The Publisher Process And Queues

When you create a schema using the Scribe Publisher for Dynamics NAV, Scribe generates
a schema file in .XDR format. The XDR schema is created with a node for Entity, Parent
Object, and Child Object, even if the entities or objects use the same name, such as an
Account Entity and an Account Child Object.

Although the publisher creates a schema with identical nodes, XDR schema standards
prevent the Scribe Workbench from opening or processing it. To work around this issue,
use an XML sample message as the schema. Create an XML sample message: 

l In the Scribe Console, add a new publisher as described above.


l Perform an action in the Adapter for Dynamics NAV, such as an Update or an Insert,
that causes a message to be published to the ScribeIn queue.
l Save this XML message and use it as both the sample file and the schema when
creating the DTS. 

Dynamics NAV Adapter Version - 128 -


3.1.1
Connecting Via The Query Publisher

Connecting Via The Query Publisher


Connecting via the Publisher for Dynamics NAV captures changes, one record at a time.
Data is sent as an XML message to the ScribeIn queue. From there you can create a Scribe
queue integration process to pick up the message in the queue and apply it to any target.

To Connect Via The Query Publisher

1. In the Scribe Console's Step 2 Source Connection, connect to the Adapter for
Dynamics NAV and configure the query publisher to retrieve data from Dynamics
NAV.
2. In Step 3 Configure Source, in the Configure Source dialog box, use the Filters
tab's Custom Query option to filter the data.
The best practice for a filter to capture new and changed data in Dynamics NAV is to
compare the modifiedon field to the :LastRunDateTime and :ThisRunDateTime
system variables. The modifiedon field is updated by workflows.

By comparison, the LastModifiedDate field is not updated by workflows and using it


might cause you to miss data.

Using :ThisRunDateTime can also reduce the chances of missing changed data.

Depending on your design requirements, you may also want to log in as an ignore
user so that Dynamics NAV does not process your changes. The ignore user is only
used by the integration and is only used in situations where that user's changes
should not be published.

Here is a sample filter for a query publisher connecting to Dynamics NAV.

and
modifiedon >= :LastRunDateTime
modifiedon < :ThisRunDateTime
modifiedbyname <> ”NavUser”

This reduces the chances that any data could be missed.

Notes:
l Comparing date/time stamps — For query publishers, monitors, and data views, the
Scribe Adapter for Dynamics NAV always converts date/time stamps to the logged
in user's time zone. This is the adapter default and cannot be changed to UTC/GMT.
l Custom queries — If you are defining a custom query that uses a filter on a string,
and the string contains a quote ( " ), use a second quote to escape the quote that is
contained in the string.
For example, if you are running a custom query to filter on "Drill Bit 1/4" ", you
must escape the quote inside the string. The custom query would be: "Drill Bit 1/4""
".

Dynamics NAV Adapter Version - 129 -


3.1.1
Connecting Via The Query Publisher

l Quotation marks used in strings in primary key fields cause an error to occur.
For example, using double quotations in the item number field causes the following
error: “Invalid Formula Syntax.”

Dynamics NAV Adapter Version - 130 -


3.1.1
Query Condition Dialog Box

Query Condition Dialog Box


Use the Query Condition dialog box to add conditions to filter the query results.

To open the Query Condition dialog box, in the Configure Source dialog box, on the Filters
tab, click Add Condition.

To Add A Query Condition

1. Choose a data object.


2. Choose a field.
3. Choose a comparison operator.
4. Enter a value or formula in the text box to use as the filter criteria.

Always use double quotes around character data in the query builder
and enclose the quotation within double quotes. For example: ""Yes"".

For example, select the account data object, the active field, the =operator, and
type Y in the text box. The result set for this query is all active accounts.

5. Optionally, click Variables. The Variables dialog box appears, where you can select
system or user variables to insert into the query, or design new user variables.
For example, use the system variable :LastRunDateTime with a source-modified
date/time to select all records that have changed since the last time the process was
run.

6. Optionally, use the Function Browser to find an available function. Click Insert
Function in Expression to add the function.
7. Click OK.

Dynamics NAV Adapter Version - 131 -


3.1.1
Filtering Publisher Messages

Filtering Publisher Messages


If you use decimals or datetime stamp fields when filtering publisher messages, those
fields must be in a specific format or the filter is rejected. Formats are as follows: 

l Decimal format = X,XXX.XX


l Date/time format = MM/DD/YY

Dynamics NAV Adapter Version - 132 -


3.1.1
Scribe Dynamics NAV Objects

Scribe Dynamics NAV Objects


Scribe creates Dynamics NAV objects for use in the MicrosoftDynamics NAV Object
Designer. Click your Dynamics NAV version below for the custom objects and version
information for that version:

l 2009 R2
l 2013
l 2013 R2
l 2015
l 2016
l 2017

Dynamics NAV Adapter Version - 133 -


3.1.1
Mapping object relationships

Mapping Object Relationships


The the Scribe Adapter for Dynamics NAV lets you map object relationships between any of
the 900 stock Microsoft Dynamics NAV objects and the source or target objects.

This ability to map your own object relationships and expose the information you need to
work with gives you virtually unlimited flexibility, because you do not have to rely on any
imposed, or default, relationships.

You can map as many object relationships as you like.

To Map Object Relationships

1. On the Scribe Workbench toolbar, click the Connections icon. The


Connection Manager dialog box appears.
2. Select Adapter for Microsoft Dynamics NAV, and click Edit. The Connection
Settings dialog box appears.
3. Click the Connection tab.
4. Click Adapter Settings. The Settings dialog box appears.
5. Click the Object Relationships tab, then click:
l Add — Opens the Add Relationship dialog box where you can map a new
relationship.
l Edit — Opens the Edit Relationship dialog box where you can edit the selected
relationship.
l Delete — Deletes the selected relationship.
6. To add or edit an object relationship, select, the object that you want to map from:
l Parent Table — The name of the parent table you want to map from.
l Child Table — The name of the child table you want to map from.
7. Choose the object you want to map to:
l Parent Field — The name of the parent field you want to map to.
l Child Field — The name of the child field you want to map to.
8. Click OK to save your mapping and return to the Connection Settings dialog box
where you can add, edit, or delete additional mappings.
Mapping To Fixed Values
Create mappings to fixed values by enclosing the value in curly brackets ("{" and "}"). For
example, entering {0} maps the object to the fixed value zero.

Mappings are assigned names using their parent table name, followed by their child table
name in parenthesis. Additional child fields are separated by a pipe. The name then shows
the parent and child tables to which the objects are mapped. For example:

SalesHeader( No. | DocumentType ) to SalesLine( DocumentNo. | DocumentType


)

Dynamics NAV Adapter Version - 134 -


3.1.1
Scribe Dynamics NAV Objects — Dynamics NAV 2009 R2

Scribe Dynamics NAV Objects —


Dynamics NAV 2009 R2
Several objects are created by Scribe for use in the Microsoft Dynamics NAV Object
Designer. These can be categorized as:

l Tables
l Forms
l Dataport
l Codeunits
l MenuSuite
The following table lists those categorized objects.

Object
Custom Objects Description
Version
Tables
Scribe Custom Actions 1.5 Stores default custom actions.
Scribe Action Parameters 1.5 Stores parameters for custom actions in the Scribe
Custom Actions table.
Scribe Parameters Buffer 1.5 Stores parameters for custom actions that are passed
in through Scribe.
Scribe Publisher Settings 1.5 Stores information on what operations, records, or
filters trigger publishing. This value is automatically
populated when you create a Scribe Publisher.
Scribe Publisher Queue 1.5 Stores records changed from subscribed events in the
Scribe Publisher Settings table. For more information,
see Configuring The Publisher.
Scribe Validation Rules 3.0 Stores the Scribe Validation Rules and Field Order
Overrides for validation order.
Scribe Field Order Override 1.5 Used to parse through the Field Order Override
column in the Scribe Validation Rules table.
NAS Port Configuration 1.5 Stores different port numbers for environments with
multiple NASs.
Scribe User 1.5 Stores user information.
Authentication
Scribe Permission Cache 1.5 Cache to temporarily store information about current
User.
Scribe Open Query 1.5 Stores current Scribe queries.
Scribe Query Filter 1.5 Stores information on Scribe query filters.
Scribe Query Column 1.5 Stores information on Scribe query fields.

Dynamics NAV Adapter Version - 135 -


3.1.1
Scribe Dynamics NAV Objects — Dynamics NAV 2009 R2

Object
Custom Objects Description
Version
ScribePriceLevels 1.5 Stores Price Levels for template.
ScribeProducts 1.8.2 Stores Products for template.
ScribeSalesPrices 1.5 Stores Sales Prices for template.
Forms
Scribe Custom Actions 1.5 Enables using the navigation pane for default custom
actions.
Scribe Custom Action Card 1.5 Enables using the navigation pane for custom actions.
Scribe Custom Action 1.5 Enables using the navigation pane for custom actions.
Subform
Scribe Publisher Settings 1.5 Enables using the navigation pane for the operations,
records, or filters that trigger publishing. This value is
automatically populated when you create a Scribe
Publisher.
Scribe Publisher Queue 1.5 Enables using the navigation pane for records
changed from subscribed events in the Scribe
Publisher Settings table. For more information, see
Configuring The Publisher.
Scribe Validation Rules 1.5 Enables using the navigation pane for Scribe
Validation Rules and Field Order Overrides for
validation order.
Scribe Field Order Override 1.5 Enables using the navigation pane to parse through
the Field Order Override column in the Scribe
Validation Rules table.
Scribe NAS Port 1.5 Enables using the navigation pane for different port
Configuration numbers for environments with multiple NASs.
Scribe Table List 1.5 Enables using the navigation pane for table lists.
Scribe Table Field List 1.5 Enables using the navigation pane for field lists.
Dataport
Scribe Validation Rules 1.5 Imports the Scribe Validation Rules and Field Order
Import Overrides for validation order.
Codeunits
Scribe Create Default 1.5 Populates the Scribe Custom Actions table.
Actions
Scribe Adapter Hooks 3.0 Allows Scribe to communicate with NAV through the
NAS.
Scribe Publisher 1.7 Manages the interactions between the Scribe
Publisher Settings and Scribe Publisher Queue tables.
Scribe Type Conventions 1.5 Manages Scribe data type conversions.
Scribe Adapter Commands 3.0 Manages integration operations for Scribe.

Dynamics NAV Adapter Version - 136 -


3.1.1
Scribe Dynamics NAV Objects — Dynamics NAV 2009 R2

Object
Custom Objects Description
Version
Scribe Sales Quote -> 1.5 Works with Scribe Custom Actions and the template
Order to convert Sales Quote to Orders.
Scribe Release Sales Doc. 1.5 Works with Scribe Custom Actions and the template
to release Sales Docs.
Scribe Post Sales Order 1.5 Works with Scribe Custom Actions and the template
to post Sales Orders.
Scribe Reopen Sales Doc 1.5 Works with Scribe Custom Actions and the template
to reopen Sales Docs.
MenuSuite
Scribe Integration 1.5 Adds parent navigation node for all Scribe integration
forms.

Dynamics NAV Adapter Version - 137 -


3.1.1
Scribe Dynamics NAV Objects — Dynamics NAV 2013

Scribe Dynamics NAV Objects —


Dynamics NAV 2013
Several objects are created by Scribe for use in the Microsoft Dynamics NAV Object
Designer. These can be categorized as:

l Tables
l Codeunits
l XML Port
The following table lists those categorized objects.

Object
Custom Objects Description
Version
Tables
Scribe Custom Actions 1.8 Stores default custom actions.
Scribe Action Parameters 1.8 Stores parameters for custom actions in the Scribe
Custom Actions table.
Scribe Parameters Buffer 1.8 Stores parameters for custom actions that are passed
in through Scribe.
Scribe Publisher Settings 1.8 Stores information on what operations, records, or
filters trigger publishing. This value is automatically
populated when you create a Scribe Publisher.
Scribe Publisher Queue 1.8 Stores records changed from subscribed events in the
Scribe Publisher Settings table. For more information,
see Configuring The Publisher.
Scribe Validation Rules 3.0 Stores the Scribe Validation Rules and Field Order
Overrides for validation order.
Scribe Field Order Override 1.8 Used to parse through the Field Order Override
column in the Scribe Validation Rules table.
NAS Port Configuration 1.8 Stores different port numbers for environments with
multiple NASs.
Scribe User 1.8 Stores user information.
Authentication
Scribe Permission Cache 1.8 Cache to temporarily store information about current
User.
Scribe Open Query 1.8 Stores current Scribe queries.
Scribe Query Filter 1.8 Stores information on Scribe query filters.
Scribe Query Column 1.8 Stores information on Scribe query fields
ScribePriceLevels 1.5 Stores Price Levels for template.
ScribeProducts 1.8.2 Stores Products for template.

Dynamics NAV Adapter Version - 138 -


3.1.1
Scribe Dynamics NAV Objects — Dynamics NAV 2013

Object
Custom Objects Description
Version
ScribeSalesPrices 1.8 Stores Sales Prices for template.
Codeunits
Scribe Create Default 1.5 Populates the Scribe Custom Actions table.
Actions
Scribe Adapter Hooks 3.0 Allows Scribe to communicate with NAV through the
NAS.
Scribe Publisher 1.8 Manages the interactions between the Scribe
Publisher Settings and Scribe Publisher Queue tables.
Scribe Type Conventions 1.8 Manages Scribe data type conversions.
Scribe Adapter Commands 3.0 Manages integration operations for Scribe.
Scribe Sales Quote -> 1.5 Works with Scribe Custom Actions and the template
Order to convert Sales Quote to Orders.
Scribe Release Sales Doc. 1.5 Works with Scribe Custom Actions and the template
to release Sales Docs
Scribe Post Sales Order 1.5 Works with Scribe Custom Actions and the template
to post Sales Orders.
Scribe Reopen Sales Doc 1.5 Works with Scribe Custom Actions and the template
to reopen Sales Docs.
XML port
Scribe Validation Rules 1.5 Imports the Scribe Validation Rules and Field Order
Import Overrides for validation order.

Dynamics NAV Adapter Version - 139 -


3.1.1
Scribe Dynamics NAV Objects — Dynamics NAV 2013 R2

Scribe Dynamics NAV Objects —


Dynamics NAV 2013 R2
Several objects are created by Scribe for use in the Microsoft Dynamics NAV Object
Designer. These can be categorized as:

l Tables
l Codeunits
l XML Port
The following table lists those categorized objects.

Object
Custom Objects Description
Version
Tables
Scribe Custom Actions 1.8 Stores default custom actions.
Scribe Action Parameters 1.8 Stores parameters for custom actions in the Scribe
Custom Actions table.
Scribe Parameters Buffer 1.8 Stores parameters for custom actions that are passed
in through Scribe.
Scribe Publisher Settings 1.8 Stores information on what operations, records, or
filters trigger publishing. This value is automatically
populated when you create a Scribe Publisher.
Scribe Publisher Queue 1.8 Stores records changed from subscribed events in the
Scribe Publisher Settings table. For more information,
see Configuring The Publisher.
Scribe Validation Rules 3.0 Stores the Scribe Validation Rules and Field Order
Overrides for validation order.
Scribe Field Order Override 1.8 Used to parse through the Field Order Override
column in the Scribe Validation Rules table.
NAS Port Configuration 1.8 Stores different port numbers for environments with
multiple NASs.
Scribe User 1.8 Stores user information.
Authentication
Scribe Permission Cache 1.8 Cache to temporarily store information about current
User.
Scribe Open Query 1.8 Stores current Scribe queries.
Scribe Query Filter 1.8 Stores information on Scribe query filters
Scribe Query Column 1.8 Stores information on Scribe query fields.
ScribePriceLevels 1.5 Stores Price Levels for template.
ScribeProducts 2.0.1 Stores Products for template.

Dynamics NAV Adapter Version - 140 -


3.1.1
Scribe Dynamics NAV Objects — Dynamics NAV 2013 R2

Object
Custom Objects Description
Version
ScribeSalesPrices 1.5 Stores Sales Prices for template.
Codeunits
Scribe Create Default 1.5 Populates the Scribe Custom Actions table.
Actions
Scribe Adapter Hooks 3.0 Allows Scribe to communicate with NAV through the
NAS.
Scribe Publisher 1.8 Manages the interactions between the Scribe
Publisher Settings and Scribe Publisher Queue tables.
Scribe Type Conventions 1.8 Manages Scribe data type conversions.
Scribe Adapter Commands 3.0 Manages integration operations for Scribe
Scribe Execute Insert 3.0 Publishes Insert operations.
Scribe Execute Update 3.0 Publishes Create operations.
Scribe Execute Delete 1.9 Publishes Delete operations.
Scribe Execute Custom 2.0 Executes custom actions based on the Scribe Custom
Action Actions table.
Scribe Execute Get Next 1.9 Retrieves next record based on QueryId.
Scribe Execute Get Comp. 1.9 Retrieves company name of current NAV company.
Name
Scribe Execute Get Tables 1.9 Gets and formats table information from NAV for
Scribe to use.
Scribe Execute Get Fields 1.9 Gets and formats field information from NAV for Scribe
to use.
Scribe Execute Open 1.9 Creates and formats a new query for NAV based on
Query input from Scribe.
Scribe Execute Close 1.9 Closes Scribe Query based on QueryId.
Query
Scribe Sales Quote -> 1.5 Works with Scribe Custom Actions and the template
Order to convert Sales Quote to Orders.
Scribe Release Sales Doc. 1.5 Works with Scribe Custom Actions and the template
to release Sales Docs
Scribe Post Sales Order 1.5 Works with Scribe Custom Actions and the template
to post Sales Orders.
Scribe Reopen Sales Doc 1.5 Works with Scribe Custom Actions and the template
to reopen Sales Docs.
XML port
Scribe Validation Rules 1.8 Imports the Scribe Validation Rules and Field Order
Import Overrides for validation order.

Dynamics NAV Adapter Version - 141 -


3.1.1
Scribe Dynamics NAV Objects — Dynamics NAV 2015

Scribe Dynamics NAV Objects —


Dynamics NAV 2015
Several objects are created by Scribe for use in the Microsoft Dynamics NAV Object
Designer. These can be categorized as:

l Tables
l Codeunits
l XML Port
The following table lists those categorized objects.

Object
Custom Objects Description
Version
Tables
Scribe Custom Actions 1.8 Stores default custom actions.
Scribe Action Parameters 1.8 Stores parameters for custom actions in the Scribe
Custom Actions table..
Scribe Parameters Buffer 1.8 Stores parameters for custom actions that are passed
in through Scribe.
Scribe Publisher Settings 1.8 Stores information on what operations, records, or
filters trigger publishing. This value is automatically
populated when you create a Scribe Publisher.
Scribe Publisher Queue 1.8 Stores records changed from subscribed events in the
Scribe Publisher Settings table. For more information,
see Configuring The Publisher.
Scribe Validation Rules 3.0 Stores the Scribe Validation Rules and Field Order
Overrides for validation order.
Scribe Field Order Override 1.8 Used to parse through the Field Order Override
column in the Scribe Validation Rules table.
NAS Port Configuration 1.8 Stores different port numbers for environments with
multiple NASs.
Scribe User 1.8 Stores user information.
Authentication
Scribe Permission Cache 1.8 Cache to temporarily store information about current
User.
Scribe Open Query 1.8 Stores current Scribe queries.
Scribe Query Filter 1.8 Stores information on Scribe query filters.
Scribe Query Column 1.8 Stores information on Scribe query fields.
ScribePriceLevels 1.5 Stores Price Levels for template.
ScribeProducts 2.0.1 Stores Products for template.

Dynamics NAV Adapter Version - 142 -


3.1.1
Scribe Dynamics NAV Objects — Dynamics NAV 2015

Object
Custom Objects Description
Version
ScribeSalesPrices 1.5 Stores Sales Prices for template.
Codeunits
Scribe Create Default 1.5 Populates the Scribe Custom Actions table.
Actions
Scribe Adapter Hooks 3.0 Allows Scribe to communicate with NAV through the
NAS.
Scribe Publisher 1.8 Manages the interactions between the Scribe
Publisher Settings and Scribe Publisher Queue tables.
Scribe Type Conventions 1.8 Manages Scribe data type conversions.
Scribe Adapter Commands 3.0 Manages integration operations for Scribe
Scribe Execute Insert 3.0 Publishes Insert operations.
Scribe Execute Update 3.0 Publishes Create operations.
Scribe Execute Delete 1.9 Publishes Delete operations.
Scribe Execute Custom 2.0 Executes custom actions based on the Scribe Custom
Action Actions table.
Scribe Execute Get Next 1.9 Retrieves next record based on QueryId.
Scribe Execute Get Comp. 1.9 Retrieves company name of current NAV company.
Name
Scribe Execute Get Tables 1.9 Gets and formats table information from NAV for
Scribe to use.
Scribe Execute Get Fields 1.9 Gets and formats field information from NAV for Scribe
to use.
Scribe Execute Open 1.9 Creates and formats a new query for NAV based on
Query input from Scribe.
Scribe Execute Close 1.9 Closes Scribe Query based on QueryId.
Query
Scribe Sales Quote -> 1.5 Works with Scribe Custom Actions and the template
Order to convert Sales Quote to Orders.
Scribe Release Sales Doc. 1.5 Works with Scribe Custom Actions and the template
to release Sales Docs.
Scribe Post Sales Order 1.5 Works with Scribe Custom Actions and the template
to post Sales Orders.
Scribe Reopen Sales Doc 1.5 Works with Scribe Custom Actions and the template
to reopen Sales Docs.
XML port
Scribe Validation Rules 1.8 Imports the Scribe Validation Rules and Field Order
Import Overrides for validation order.

Dynamics NAV Adapter Version - 143 -


3.1.1
Scribe Dynamics NAV Objects — Dynamics NAV 2016

Scribe Dynamics NAV Objects —


Dynamics NAV 2016
Several objects are created by Scribe for use in the Microsoft Dynamics NAV Object
Designer. These can be categorized as:

l Tables
l Codeunits
l XML Port
The following table lists those categorized objects.

Object
Custom Objects Description
Version
Tables
Scribe Custom Actions 1.8 Stores default custom actions.
Scribe Action Parameters 1.8 Stores parameters for custom actions in the Scribe
Custom Actions table.
Scribe Parameters Buffer 1.8 Stores parameters for custom actions that are passed
in through Scribe.
Scribe Publisher Settings 1.8 Stores information on what operations, records, or
filters trigger publishing. This value is automatically
populated when you create a Scribe Publisher.
Scribe Publisher Queue 1.8 Stores records changed from subscribed events in the
Scribe Publisher Settings table. For more information,
see Configuring The Publisher.
Scribe Validation Rules 3.0 Stores the Scribe Validation Rules and Field Order
Overrides for validation order.
Scribe Field Order Override 1.8 Used to parse through the Field Order Override
column in the Scribe Validation Rules table.
NAS Port Configuration 1.8 Stores different port numbers for environments with
multiple NASs.
Scribe User 1.8 Stores user information.
Authentication
Scribe Permission Cache 1.8 Cache to temporarily store information about current
User.
Scribe Open Query 1.8 Stores current Scribe queries.
Scribe Query Filter 1.8 Stores information on Scribe query filters.
Scribe Query Column 1.8 Stores information on Scribe query fields.
ScribePriceLevels 1.5 Stores Price Levels for template.
ScribeProducts 2.0.1 Stores Products for template.

Dynamics NAV Adapter Version - 144 -


3.1.1
Scribe Dynamics NAV Objects — Dynamics NAV 2016

Object
Custom Objects Description
Version
ScribeSalesPrices 1.5 Stores Sales Prices for template.
Codeunits
Scribe Create Default 1.5 Populates the Scribe Custom Actions table.
Actions
Scribe Adapter Hooks 3.0 Allows Scribe to communicate with NAV through the
NAS.
Scribe Publisher 2.0.2 Manages the interactions between the Scribe
Publisher Settings and Scribe Publisher Queue tables.
Scribe Type Conventions 1.8 Manages Scribe data type conversions.
Scribe Adapter Commands 3.0 Manages integration operations for Scribe.
Scribe Execute Insert 3.0 Publishes Insert operations.
Scribe Execute Update 3.0 Publishes Create operations.
Scribe Execute Delete 1.9 Publishes Delete operations.
Scribe Execute Custom 2.0 Executes custom actions based on the Scribe Custom
Action Actions table.
Scribe Execute Get Next 1.9 Retrieves next record based on QueryId.
Scribe Execute Get Comp. 1.9 Retrieves company name of current NAV company.
Name
Scribe Execute Get Tables 1.9 Gets and formats table information from NAV for
Scribe to use.
Scribe Execute Get Fields 1.9 Gets and formats field information from NAV for Scribe
to use.
Scribe Execute Open 1.9 Creates and formats a new query for NAV based on
Query input from Scribe.
Scribe Execute Close 1.9 Closes Scribe Query based on QueryId.
Query
Scribe Sales Quote -> 1.5 Works with Scribe Custom Actions and the template
Order to convert Sales Quote to Orders.
Scribe Release Sales Doc. 1.5 Works with Scribe Custom Actions and the template
to release Sales Docs.
Scribe Post Sales Order 1.5 Works with Scribe Custom Actions and the template
to post Sales Orders.
Scribe Reopen Sales Doc 1.5 Works with Scribe Custom Actions and the template
to reopen Sales Docs.
XML port
Scribe Validation Rules 1.8 Imports the Scribe Validation Rules and Field Order
Import Overrides for validation order.

Dynamics NAV Adapter Version - 145 -


3.1.1
Scribe Dynamics NAV Objects — Dynamics NAV 2017

Scribe Dynamics NAV Objects —


Dynamics NAV 2017
Several objects are created by Scribe for use in the Microsoft Dynamics NAV Object
Designer. These can be categorized as:

l Tables
l Codeunits
l XML Port
The following table lists those categorized objects.

Object
Custom Objects Description
Version
Tables
Scribe Custom Actions 1.8 Stores default custom actions.
Scribe Action Parameters 1.8 Stores parameters for custom actions in the Scribe
Custom Actions table.
Scribe Parameters Buffer 1.8 Stores parameters for custom actions that are passed
in through Scribe.
Scribe Publisher Settings 1.8 Stores information on what operations, records, or
filters trigger publishing. This value is automatically
populated when you create a Scribe Publisher.
Scribe Publisher Queue 1.8 Stores records changed from subscribed events in the
Scribe Publisher Settings table. For more information,
see Configuring The Publisher.
Scribe Validation Rules 3.0 Stores the Scribe Validation Rules and Field Order
Overrides for validation order.
Scribe Field Order Override 1.8 Used to parse through the Field Order Override
column in the Scribe Validation Rules table.
NAS Port Configuration 1.8 Stores different port numbers for environments with
multiple NASs.
Scribe User 1.8 Stores user information.
Authentication
Scribe Permission Cache 1.8 Cache to temporarily store information about current
User.
Scribe Open Query 1.8 Stores current Scribe queries.
Scribe Query Filter 1.8 Stores information on Scribe query filters.
Scribe Query Column 1.8 Stores information on Scribe query fields.
ScribePriceLevels 1.5 Stores Price Levels for template.
ScribeProducts 2.0.1 Stores Products for template.

Dynamics NAV Adapter Version - 146 -


3.1.1
Scribe Dynamics NAV Objects — Dynamics NAV 2017

Object
Custom Objects Description
Version
ScribeSalesPrices 1.5 Stores Sales Prices for template.
Codeunits
Scribe Create Default 1.5 Populates the Scribe Custom Actions table.
Actions
Scribe Adapter Hooks 3.1 Allows Scribe to communicate with NAV through the
NAS.
Scribe Publisher 2.0.2 Manages the interactions between the Scribe
Publisher Settings and Scribe Publisher Queue tables.
Scribe Type Conventions 3.1 Manages Scribe data type conversions.
Scribe Adapter Commands 3.0 Manages integration operations for Scribe.
Scribe Execute Insert 3.0 Publishes Insert operations.
Scribe Execute Update 3.0 Publishes Create operations.
Scribe Execute Delete 1.9 Publishes Delete operations.
Scribe Execute Custom 2.0 Executes custom actions based on the Scribe Custom
Action Actions table.
Scribe Execute Get Next 1.9 Retrieves next record based on QueryId.
Scribe Execute Get Comp. 1.9 Retrieves company name of current NAV company.
Name
Scribe Execute Get Tables 1.9 Gets and formats table information from NAV for
Scribe to use.
Scribe Execute Get Fields 1.9 Gets and formats field information from NAV for Scribe
to use.
Scribe Execute Open 1.9 Creates and formats a new query for NAV based on
Query input from Scribe.
Scribe Execute Close 1.9 Closes Scribe Query based on QueryId.
Query
Scribe Sales Quote -> 1.5 Works with Scribe Custom Actions and the template
Order to convert Sales Quote to Orders.
Scribe Release Sales Doc. 1.5 Works with Scribe Custom Actions and the template
to release Sales Docs.
Scribe Post Sales Order 1.5 Works with Scribe Custom Actions and the template
to post Sales Orders.
Scribe Reopen Sales Doc 1.5 Works with Scribe Custom Actions and the template
to reopen Sales Docs.
XML port
Scribe Validation Rules 1.8 Imports the Scribe Validation Rules and Field Order
Import Overrides for validation order.

Dynamics NAV Adapter Version - 147 -


3.1.1
Custom Actions

Custom Actions
Custom actions functionality has been created to run C/AL code on the Microsoft Dynamics
NAV side and return the results to Scribe Insight.

When starting to work with actions, make sure that corresponding records
are created in the Scribe Custom Actions and Scribe Action Parameters
tables. If there are no action descriptions, see Activating The Scribe Actions.

After the Scribe Custom Actions and Scribe Action Parameters tables are filled with data,
the information about actions becomes available in Scribe Insight.

As an example, Scribe Adapter for Microsoft Dynamics NAV provides the following actions
which include the sales document flow and which become available in the Microsoft
Dynamics NAV after the import:

l ConvertSalesQuote
l ReleaseSalesDocument
l ReopenSalesDocument
l PostSalesOrder
You can also create customized actions for the processes that your business requires.

Working with actions requires an advanced level of Microsoft Dynamics NAV


system knowledge. Do not attempt to create the actions unless the you are
comfortable reading and editing Microsoft Dynamics NAV codeunits.

Review the following information regarding actions:

l Standard actions overview


l Developing custom actions
l Custom action methods
l Dynamics NAV: Creating custom actions

Dynamics NAV Adapter Version - 148 -


3.1.1
Standard Actions

Standard Actions
When configuring the target adapter for Microsoft Dynamics NAV, the following actions are
available under the Stored Procedures node on the Data Objects tab of the Configure
Steps window:

l ConvertSalesQuote — The action performs the conversion of a sales quote to a


sales order and has the QuoteNoToConvert input and the ConvertedOrderNo output
parameters.
l ReleaseSalesDocument — The action changes the status of the sales document,
namely a sales order or a sales quote, from ”Open” to ”Released”. The action has
two input parameters - ReleaseDocType and ReleaseDocNo.

After the status of a sales order is ”Released”, you cannot modify the
order unless you reopen it by running the corresponding custom
action.

l ReopenSalesDocument — The action changes the status of the sales document,


namely a sales order or a sales quote, from ”Released” to ”Open”. The action has
two input parameters - ReleaseDocType and ReleaseDocNo.

The ReleaseSalesDocument and ReopenSalesDocument actions have


the same parameters but perform two opposite functions.

l PostSalesOrder — The action executes posting of a sales order and has the
OrderNoToPost input and PostedInvoiceNo output parameters.

Dynamics NAV Adapter Version - 149 -


3.1.1
Developing Custom Actions

Developing Custom Actions


When the custom action parameters are passed from Scribe Insight to Dynamics NAV, they
are converted to records in the Scribe Parameters Buffer table.

When designing a codeunit for the custom action, its TableNo property must be set to
”Scribe Parameters Buffer”. This can be done by pressing SHIFT + F4 in the design mode of
a codeunit.

All custom actions must be set up in this way.

In the design of each custom action, there is the OnRun trigger that controls the receipt of
input parameters from the Scribe Parameters Buffer table. It calls the function that
initializes input parameters, performs the action, sets the output parameters, and resets
custom action definition to default. The following code sample represents the OnRun trigger
of the ConvertSalesQuote action.

OnRun(VAR Rec : Record "Scribe Parameters Buffer"


// information will be reset if 'ResetToDefaults' parameter is passed
IF ResetToDefaults(Rec) THEN
EXIT;
// set global variables 'DocumentType' and 'DocumentNo' with actual data
GetInputParameters(Rec);
// execute action
ExecuteCustomAction();
// set output parameters
SetOutputParameters(Rec);

The following table displays the global variables defined for the ConvertSalesQuote custom
action.

Name DataType Subtype Length


SalesQuoteToOrder Codeunit Sales-Quote to Order DocumentNo
Code 20

Dynamics NAV Adapter Version - 150 -


3.1.1
Custom Action Methods

Custom Action Methods


When designing a custom action, note that it must consist of the following four methods:

GetInputParameters
Initializes the input parameters. An input parameter for the name is taken from the buffer
and the global variable is assigned its value. Refer to the following code sample to examine
the GetInputParameters method.

GetInputParameters (VAR Buffer : Record "Scribe Parameters Buffer")


// get 'QuoteNoToConvert' parameter

Buffer.GET'QuoteNoToConvert';
DocumentNo := Buffer.Value;

ExecuteCustomAction
Uses the initialized variables from the previous step, calls C/AL code. The following code
sample displays the ExecuteCustomAction method.

ExecuteCustomAction ()
// get sales header to post
SalesHeader.GET(SalesHeader."Document Type"::Quote, DocumentNo);
// convert sales quote to order
SalesQuoteToOrder.SetHideValidationDialog(TRUE);
SalesQuoteToOrder.RUN(SalesHeader);

The following table displays the local variables defined for this procedure.

Name DataType Subtype Length


SalesHeader Record Sales Header

SetOutputParameters
Inserts the name and the value of the output parameter to the buffer. Refer to the following
code sample to examine the SetOutputParameters method.

The GetOutputParameters and SetOutputParameters methods must be


designed to read data from and write data to the Scribe Parameters Buffer
table.

SetOutputParameters(VAR Buffer : Record "Scribe Parameters Buffer")

Dynamics NAV Adapter Version - 151 -


3.1.1
Custom Action Methods

// set output parameters


SalesQuoteToOrder.GetSalesOrderHeader(ConvertedSalesHeader);
Buffer.INIT;
Buffer.Name := 'ConvertedOrderNo';
Buffer."No." := 2;
Buffer.Value := ConvertedSalesHeader."No.";
Buffer.INSERT;

The following table provides local variables defined for this procedure.

Name DataType Subtype Length


ConvertedSalesHeader Record Sales Header

If designing the GetInputParameters and SetOutputParameters methods, there is a need to


convert values from text to any Microsoft Dynamics NAV data type or from any Dynamics
NAV data type to text. For this purpose, you can use the predefined type convert methods
placed in the Scribe Type Conventions codeunit. The following are some of these type
convert methods: TextToInteger, TextToBigInteger, TextToBoolean, TextToDecimal.

You can view the complete list of these functions under View > C/AL Symbol Menu
when in the design mode of the codeunit.

ResetToDefaults
Fills the Scribe Custom Actions and Scribe Action Parameters tables with data. It checks
the Scribe Parameters Buffer table for the record identified by the "ResetToDefaults" name,
and if finds it, deletes all data that corresponds to the identification of the current custom
action, creates a record in the Scribe Custom Actions table, and creates a required number
of records in the Scribe Action Parameters table. The ResetToDefaults method passes the
'YES' (TRUE) value to the ResetToDefaults parameter to inform calling code that the current
codeunit contains the custom action and that its definition has been successfully reset. The
following code sample displays the ResetToDefaults method.

The OnRun trigger must be designed to stop running the codeunit in case the
ResetToDefaults method returns the 'YES' (TRUE),indicating that the reset to
default data is successful.

ResetToDefaults(VAR Buffer : Record "Scribe Parameters Buffer") : Boolean


// check whether 'ResetToDefaults' parameter is passed
IF NOT Buffer.GET'ResetToDefaults' THEN
EXIT(FALSE); 
// delete redundant data

Dynamics NAV Adapter Version - 152 -


3.1.1
Custom Action Methods

CustomActions.INIT;
CustomActions.SETRANGE("Codeunit No.", CODEUNIT::"Scribe Sales Quote ->
Order");
IF CustomActions.FINDFIRST THEN
CustomActions.DELETE(TRUE); 
// create 'Convert Sales Quote to Order' custom action definition
CustomActions.INIT;
CustomActions.Name := 'ConvertSalesQuote';
CustomActions.Description := 'Convert Sales Quote to Order';
CustomActions."Codeunit No." := CODEUNIT::"Scribe Sales Quote -> Order";
CustomActions."Codeunit Name" := 'Scribe Sales Quote -> Order';
CustomActions.INSERT;
// create 'Convert Sales Quote to Order' custom action parameters definition
CustomActionParameters.INIT;
CustomActionParameters."Action No." := CODEUNIT::"Scribe Sales Quote ->
Order";
CustomActionParameters."No." := 1;
CustomActionParameters.Name := 'QuoteNoToConvert';
CustomActionParameters.Description := 'Sales Quote number to convert';
CustomActionParameters.Type := CustomActionParameters.Type::"In";
CustomActionParameters.INSERT;
CustomActionParameters.INIT;
CustomActionParameters."Action No." := CODEUNIT::"Scribe Sales Quote ->
Order";
CustomActionParameters."No." := 2;
CustomActionParameters.Name := 'ConvertedOrderNo';
CustomActionParameters.Description := 'Converted Sales Order number';
CustomActionParameters.Type := CustomActionParameters.Type::Out;
CustomActionParameters.INSERT;
// 'ResetToDefaults' parameter will be set to 'YES'
Buffer.Value := FORMAT(TRUE);
Buffer.MODIFY;
EXIT(TRUE);

The following table displays the local variables defined for this procedure.

Dynamics NAV Adapter Version - 153 -


3.1.1
Custom Action Methods

Name DataType Subtype Length


CustomActions Record Scribe Custom Actions
CustomActionParameters Record Scribe Action Parameters

Dynamics NAV Adapter Version - 154 -


3.1.1
Creating Custom Actions

Creating Custom Actions


Taking into account previously mentioned recommendations, follow the steps to create a
custom action:

1. In the Microsoft Dynamics NAV client, click the Scribe Integration navigation
button.
2. Under Administration, click Custom Actions. The Scribe Custom Action Card
dialog box appeasr.
3. Press F3 to create a new action.
4. Open the Codeunit No. lookup and select the previously created codeunit from the
list.
5. Leave the header area and the system asks you to overwrite the current custom
action definition with the default data.
6. In the Type field, specify whether the record is an input or output parameter.

If the selected codeunit does not contain the ResetToDefaults method, an


error is displayed and no custom action definition is created.

Dynamics NAV Adapter Version - 155 -


3.1.1
Foreign Language Version of Dynamics NAV

Foreign Language Version Of Dynamics


NAV
If you are using a foreign language version of Dynamics NAV and the names of the system
tables for that version are not in English, you may need to modify the SCRIBE.KSYNC tables
in the Scribe Internal Database. The Scribe Internal Database (default name
SCRIBEINTERNAL) is a SQL Server database that contains information used by Scribe
Insight and is stored in the Scribe installation directory.

When the Dynamics NAV Adapter encounters a foreign language version of Dynamics NAV,
the adapter cannot find the system tables because the table names have been modified.
Errors similar to the following are generated by the adapter: 

Modifying The SCRIBE.KSYNC Tables


The SCRIBE.KSYNC tables in the Scribe Internal Database contain the names of the system
tables. Use SQL statements to update the system table names in your Scribe Internal
Database.

Example
Assume that you are using a Spanish language version of Dynamics NAV and the system
table names are in Spanish.

The Spanish language table names used in this example are not the table
names used by the Spanish language version of Dynamics NAV, they are
provided only to illustrate how to modify the Scribe Internal Database.

English Table Name Spanish Table Name


LicenseInformation Licencia
Text Texto
Session Sesiones
UserID NumeroUsuario
User Usuario

Dynamics NAV Adapter Version - 156 -


3.1.1
Foreign Language Version of Dynamics NAV

English Table Name Spanish Table Name


ExpiryDate FechaCaducidad
UserName NombreUsuario

In the table above the English names are the table names expected by Scribe. The Spanish
table names are the ones currently in the system tables. To modify the Scribe Internal
Database to recognize the Spanish table names do the following: 

1. Open SQL Server Management Studio or another tool that allows you to run SQL
statements.
2. Locate the Scribe Internal Database.
3. Below are a set of SQL statements with the table names in English. These are only for
illustration purposes.
update SCRIBE.KSYNC set KEYVALUE='LicenseInformation' where SECTION='ADAPTERS'
and KEYNAME='DYNAMICSNAVADAPTER.LICENSEINFOTABLENAME'
update SCRIBE.KSYNC set KEYVALUE='Text' where SECTION='ADAPTERS' and
KEYNAME='DYNAMICSNAVADAPTER.LICENSEINFOCOLUMNNAME' update SCRIBE.KSYNC set
KEYVALUE='Session' where SECTION='ADAPTERS' and
KEYNAME='DYNAMICSNAVADAPTER.SESSIONTABLENAME'
update SCRIBE.KSYNC set KEYVALUE='UserID' where SECTION='ADAPTERS' and
KEYNAME='DYNAMICSNAVADAPTER.USERIDCOLUMNNAME'
update SCRIBE.KSYNC set KEYVALUE='User' where SECTION='ADAPTERS' and
KEYNAME='DYNAMICSNAVADAPTER.USERTABLENAME'
update SCRIBE.KSYNC set KEYVALUE='ExpiryDate' where SECTION='ADAPTERS' and
KEYNAME='DYNAMICSNAVADAPTER.2013EXPIRATIONDATECOLUMNNAME'
update SCRIBE.KSYNC set KEYVALUE='UserName' where SECTION='ADAPTERS' and
KEYNAME='DYNAMICSNAVADAPTER.2013USERNAMECOLUMNNAME'

4. Modify the KEYVALUE with the Spanish table name and execute the following SQL
statements to change the SCRIBE.KSYNC tables:
update SCRIBE.KSYNC set KEYVALUE='Licencia' where SECTION='ADAPTERS' and
KEYNAME='DYNAMICSNAVADAPTER.LICENSEINFOTABLENAME'
update SCRIBE.KSYNC set KEYVALUE='Texto' where SECTION='ADAPTERS' and
KEYNAME='DYNAMICSNAVADAPTER.LICENSEINFOCOLUMNNAME'
update SCRIBE.KSYNC set KEYVALUE='Sesiones' where SECTION='ADAPTERS' and
KEYNAME='DYNAMICSNAVADAPTER.SESSIONTABLENAME'
update SCRIBE.KSYNC set KEYVALUE='NumeroUsuario' where SECTION='ADAPTERS' and
KEYNAME='DYNAMICSNAVADAPTER.USERIDCOLUMNNAME'
update SCRIBE.KSYNC set KEYVALUE='Usuario' where SECTION='ADAPTERS' and
KEYNAME='DYNAMICSNAVADAPTER.USERTABLENAME'
update SCRIBE.KSYNC set KEYVALUE='FechaCaducidad' where SECTION='ADAPTERS' and
KEYNAME='DYNAMICSNAVADAPTER.2013EXPIRATIONDATECOLUMNNAME'
update SCRIBE.KSYNC set KEYVALUE='NombreUsuario' where SECTION='ADAPTERS' and
KEYNAME='DYNAMICSNAVADAPTER.2013USERNAMECOLUMNNAME'

Dynamics NAV Adapter Version - 157 -


3.1.1
Foreign Language Version of Dynamics NAV

5. As each statement is executed, the table names are updated in the Scribe Internal
Database.

Dynamics NAV Adapter Version - 158 -


3.1.1
Checking Your Adapter's Version Number

Checking Your Adapter's Version


Number
Your adapter's version number and connection settings are shown on About tab of the
Settings dialog box.

1. On the Scribe Workbench toolbar, click the Connections icon. The Connection
Manager dialog box appears.
2. Select Adapter for Microsoft Dynamics NAV, and click Edit. The Connection
Settings dialog box appears.
3. Click the DTS Connection Settings tab.
4. Click Adapter Settings. The Settings dialog box appears.
5. Click the About tab.

Dynamics NAV Adapter Version - 159 -


3.1.1
Backing Up Your Data

Backing Up Your Data


You should backup your databases before testing or initial synchronization.

Back up all of your databases at the same time as a set. If you restore the databases from
your backups, you must restore them all at the same time and from the same set of
backups.

Pause the integration components before beginning a backup.

Back up these databases:

l Scribe Internal database


l All Microsoft Dynamics NAV databases

Be sure to back up the Scribe Internal database and the collaboration root
folder regularly.

Pausing The Integration Components


Most backup operations lock files during the backup process. To reduce warnings and alerts
due to backup file locking, pause your integration processes, monitors, and publishers
before beginning a backup.

To Pause All Processes Running On The Insight Server

1. In the Scribe Console, right-click the Integration Server node and select Pause All
Integration Components.
2. Watch the Pending Integration Processes box for all integration processes to
finish running.
When all processes and monitors are finished, proceed with you backups.

To Restart The Integration Processes

In the Scribe Console, right-click the Integration Server node and click Resume
All Integration Components.

Dynamics NAV Adapter Version - 160 -


3.1.1
Uninstalling The Adapter

Uninstalling The Adapter


When removing the Dynamics NAV Adapter, you must do the following:

l Remove the NAS Components


l Uninstall the Dynamics NAV
l In Dynamics NAV:
o Remove the Scribe customizations in the codeunits
o Remove the Scribe components registrations

Remove The NAS Components


1. Open the directory containing the msi installation packages.
l If you extracted the msi files from the
ScribeAdapterForMicrosoftDynamicsNAV.exe, the default directory is
C:\ScribeAdapterForMicrosoftDynamicsNAV.
l If you installed Scribe Insight open either ..\ScribeInsight792_
x64\Adapters or ..\ScribeInsight792_x32\Adapters.
2. Copy or move the version-specific msi installation package to the Dynamics NAV NAS
Service Server. For example, if your Dynamics NAV NAS Service instance is for
Dynamics NAV 2016, you would copy the
ScribeAdapterForMicrosoftDynamicsNAV2016NAS_Service.msi file.
3. On the Dynamics NAV NAS server, double-click the version-specific msi installation
package that you copied. The Adapter Installation wizard appears.
4. Select the Remove option and follow the instructions in the Wizard to remove the
NAS components.
5. Click Finish to exit the wizard.

Multiple Organizations
If you are supporting more than one Dynamics NAV company or organization, you need to
remove the following files and folders from each NAS instance's folder.

l Files:
o Microsoft.Dynamics.Nav.Types.dll
o Scribe.NavAdapter.NasHook.dll
o Scribe.NavAdapter.NasHook.tlb
o Scribe.NavAdapter.NasHook.XmlSerializers.dll
o ScribeNasSettings.xml
l Folders:
o \ScribeModifications
o \ReleaseNotes

Dynamics NAV Adapter Version - 161 -


3.1.1
Uninstalling The Adapter

Uninstall The Adapter


Uninstall the current Adapter with the Setup.exe Wizard.

1. Locate Setup.exe in your Scribe Insight installation folder, either


C:\ScribeInsight7xx_x32 or C:\ScribeInsight7xx_x64.
2. Right-click Setup.exe and select Run as Administrator.
3. Check the box next to Insight Adapters and click Start Installation.
4. Uncheck the box next to the Adapter and click OK.
5. Click OK in the pop-up that says: Scribe services must be stopped before continuing .
. . The Wizard continues and uninstalls the current Adapter.
6. Exit the Setup Wizard.

Remove The Scribe Codeunit Customizations


See Editing The Codeunits to locate the correct information for your version of Dynamics
NAV. Remove the Scribe modifications referenced for each codeunit.

Remove The Scribe Component Registrations


1. Open the Dynamics NAV Development Environment.
2. In the Object Designer, navigate to Table->2000000069 and Run the table. This
opens the Dynamics NAV UI and brings you to the Add-Ins table.
3. Select the row with the Add-in Name value of Scribe.NavAdapter.NasHook.dll
and delete it.

Dynamics NAV Adapter Version - 162 -


3.1.1

You might also like