Adapter For Dynamics NAV - Developer Guide 2/22/2018
Adapter For Dynamics NAV - Developer Guide 2/22/2018
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.
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.
Contents
Contents 3
Use Cases 12
Requirements 15
Limitations 15
Adapter-Only Release 19
Importing A .fob 28
Importing A .fob 29
Importing A .fob 30
Importing A .fob 32
Importing A .fob 34
Importing A .fob 36
Modified Codeunits 52
Unmodified Codeunits 52
Notes: 129
GetInputParameters 151
ExecuteCustomAction 151
SetOutputParameters 151
ResetToDefaults 152
Example 156
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.
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.
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:
Use Cases
Use the Dynamics NAV Adapter to migrate or integrate data as follows:
Custom Dynamics NAV code for this Adapter is developed and tested on W1
region installations. Use with other regions will require modifications.
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.
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.
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.
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:
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.
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.
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.
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.
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.
Use only the msi file that matches your Dynamics NAV NAS
version.
..\ScribeInsight792_x64\Adapters
..\ScribeInsight792_x32\Adapters
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.
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.
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.
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.
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:
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.
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.
When connecting to the Adapter, use the server name and port number in the
NAS Server field.
l Common — Imports codeunits for the publisher and target, and creates tables
necessary for publishing and validation.
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 Common.fob — Imports codeunits for the publisher and target, and creates tables
necessary for publishing and validation.
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.
Importing A .fob
1. In Dynamics NAV, open the Object Designer.
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.
l Common2013.fob — Imports codeunits for the publisher and target, and creates
tables necessary for publishing and validation.
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.
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.
l Common2015.fob — Imports codeunits for the publisher and target, and creates
tables necessary for publishing and validation.
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.
l Common2016.fob — Imports codeunits for the publisher and target, and creates
tables necessary for publishing and validation.
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.
l Common2017.fob — Imports codeunits for the publisher and target, and creates
tables necessary for publishing and validation.
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.
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.
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.
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.
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.
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.
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.
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:
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.
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.
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
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.
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:
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:
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:
Replace:
Window.UPDATE(5,1);
IF NOT IsOnlinePayment(SalesHeader) THEN
PostBalancing(TempJnlLineDim,0)
With:
//*****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 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");
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.
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
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:
ToDocDim.DELETEALL;
Add:
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*****
10. When you are done, save the codeunit and make sure that it compiles without errors.
In the Object Designer, in the Version List column, edit the Sales-
Quote to Order codeunit's version to reflect the new revision level.
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.
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:
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);
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:
Add:
END;
Add:
//Trigger ScribePublisher
RecRef.GETTABLE(SalesHeader);
ScribePublisher.PublishModification(RecRef,xRecRef);
After:
Add :
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.
14. In the Object Designer, in the Version List column, edit the Release Sales Document
codeunit's version to reflect the new revision level.
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.
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.
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
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.
After:
ChangeLogMgt.GetDatabaseTableTriggerSetup
(TableId,OnDatabaseInsert,OnDatabaseModify,
OnDatabaseDelete,OnDatabaseRename);
IntegrationManagement.GetDatabaseTableTriggerSetup
(TableId,OnDatabaseInsert,OnDatabaseModify,
OnDatabaseDelete,OnDatabaseRename);
Add:
l Trigger Function 2
OnDatabaseInsert (RecRef : RecordRef)
After:
ChangeLogMgt.LogInsertion(RecRef);
IntegrationManagement.OnDatabaseInsert(RecRef);
Add:
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:
xRecRef RecordRef
l Trigger Function 4
OnDatabaseDelete
After:
ChangeLogMgt.LogDeletion(RecRef);
IntegrationManagement.OnDatabaseDelete(RecRef);
Add:
l Trigger Function 5
OnDatabaseRename (RecRef : RecordRef;xRecRef
After:
ChangeLogMgt.LogRename(RecRef,xRecRef);
IntegrationManagement.OnDatabaseRename(RecRef,xRecRef);
Add:
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.
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
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.
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.
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
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*****
This eliminates the error message when the NAS runs codeunit 80.
To Edit Codeunit 80
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:
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 CustLedgEntry.Amount = 0 THEN
GenJnlLine."Amount (LCY)" := TotalSalesLineLCY."Amount Including VAT"
ELSE
GenJnlLine."Amount (LCY)" :=
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.
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.
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;
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:
14. Close the C/AL Locals window to return to the C/AL Editor.
15. In the Reopen section:
After:
Add :
After :
WhseSalesRelease.Reopen(SalesHeader);WhseSalesRelease.Reopen(SalesHeader);
Add :
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.
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.
No changes are required for codeunit 86 for adapters for Dynamics NAV 2013
R2, Dynamics NAV 2015, or Dynamics NAV 2016.
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
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.
After:
IntegrationManagement.GetDatabaseTableTriggerSetup
(TableId,OnDatabaseInsert,OnDatabaseModify,
OnDatabaseDelete,OnDatabaseRename);
IntegrationManagement.GetDatabaseTableTriggerSetup
(TableId,OnDatabaseInsert,OnDatabaseModify,
OnDatabaseDelete,OnDatabaseRename);
Add:
l Trigger Function 2
OnDatabaseInsert (RecRef : RecordRef)
After:
ChangeLogMgt.LogInsertion(RecRef);
IntegrationManagement.OnDatabaseInsert(RecRef);
Add:
l Trigger Function 3
OnDatabaseModify (RecRef : RecordRef)
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:
publishUpdate Boolean
After:
ChangeLogMgt.LogModification(RecRef);
IntegrationManagement.OnDatabaseModify(RecRef);
Add:
In the View menu, click C\AL locals.> Variables tab and enter:
xRecRef RecordRef
After:
ChangeLogMgt.LogDeletion(RecRef);
IntegrationManagement.OnDatabaseDelete(RecRef);
Add:
l Trigger Function 4
OnDatabaseDelete
After:
ChangeLogMgt.LogDeletion(RecRef);
IntegrationManagement.OnDatabaseDelete(RecRef);
Add:
l Trigger Function 5
OnDatabaseRename (RecRef : RecordRef;xRecRef :
After:
ChangeLogMgt.LogRename(RecRef,xRecRef);
IntegrationManagement.OnDatabaseRename(RecRef,xRecRef);
Add:
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.
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
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.
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.
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
Window.UPDATE(1,STRSUBSTNO(Text007,"Document
type","No.",SalesInvHeader."No."));
//*****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.
To Edit Codeunit 80
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:
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 CustLedgEntry.Amount = 0 THEN
GenJnlLine."Amount (LCY)" := TotalSalesLineLCY."Amount Including VAT"
ELSE
GenJnlLine."Amount (LCY)" :=
TotalSalesLineLCY."Amount Including VAT" +
ROUND(
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.
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.
Add:
11. At the end of the OnRun section just before the Reopen section begins:
Add:
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:
14. Close the C/AL Locals window to return to the C/AL Editor.
15. In the Reopen section:
After:
Add:
After:
WhseSalesRelease.Reopen(SalesHeader);
Add:
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.
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.
No changes are required for codeunit 86 for adapters for Dynamics NAV 2013
R2, Dynamics NAV 2015, or Dynamics NAV 2016.
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
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.
After:
ChangeLogMgt.GetDatabaseTableTriggerSetup
(TableId,OnDatabaseInsert,OnDatabaseModify,
OnDatabaseDelete,OnDatabaseRename);
IntegrationManagement.GetDatabaseTableTriggerSetup
(TableId,OnDatabaseInsert,OnDatabaseModify,
OnDatabaseDelete,OnDatabaseRename);
Add:
l Trigger Function 2
OnDatabaseInsert (RecRef : RecordRef)
After:
ChangeLogMgt.LogInsertion(RecRef);
IntegrationManagement.OnDatabaseInsert(RecRef);
Add:
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:
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:
xRecRef RecordRef
After:
ChangeLogMgt.LogModification(RecRef);
IntegrationManagement.OnDatabaseModify(RecRef);
Add:
l Trigger Function 4
OnDatabaseDelete
After:
ChangeLogMgt.LogDeletion(RecRef);
IntegrationManagement.OnDatabaseDelete(RecRef);
Add:
l Trigger Function 5
OnDatabaseRename (RecRef : RecordRef;xRecRef :
After:
ChangeLogMgt.LogRename(RecRef,xRecRef);
IntegrationManagement.OnDatabaseRename(RecRef,xRecRef);
Add:
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.
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
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.
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.
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
Window.UPDATE(1,STRSUBSTNO(Text007,"Document
type","No.",SalesInvHeader."No."));
//*****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.
To Edit Codeunit 80
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:
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:
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");
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.
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.
Add:
11. At the end of the OnRun section just before the Reopen section begins:
Add:
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:
14. Close the C/AL Locals window to return to the C/AL Editor.
15. In the Reopen section:
After:
Add:
After:
WhseSalesRelease.Reopen(SalesHeader);
Add:
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.
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.
No changes are required for codeunit 86 for adapters for Dynamics NAV 2013
R2, Dynamics NAV 2015, and Dynamics NAV 2016.
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
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
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);
IntegrationManagement.GetDatabaseTableTriggerSetup
(TableId,OnDatabaseInsert,OnDatabaseModify,
OnDatabaseDelete,OnDatabaseRename);
Add:
l Trigger Function 2
OnDatabaseInsert (RecRef : RecordRef)
After:
ChangeLogMgt.LogInsertion(RecRef);
IntegrationManagement.OnDatabaseInsert(RecRef);
Add:
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:
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:
xRecRef RecordRef
After:
ChangeLogMgt.LogModification(RecRef);
IntegrationManagement.OnDatabaseModify(RecRef);
Add:
l Trigger Function 4
OnDatabaseDelete
After:
ChangeLogMgt.LogDeletion(RecRef);
IntegrationManagement.OnDatabaseDelete(RecRef);
Add:
l Trigger Function 5
OnDatabaseRename (RecRef : RecordRef;xRecRef :
After:
ChangeLogMgt.LogRename(RecRef,xRecRef);
IntegrationManagement.OnDatabaseRename(RecRef,xRecRef);
Add:
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.
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.
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
Window.UPDATE(1,STRSUBSTNO(Text007,"Document
type","No.",SalesInvHeader."No."));
//*****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.
To Edit Codeunit 80
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:
12. Save and close C/AL Globals. You return to the C/AL Editor.
13. In the OnRun section:
After:
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");
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";
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.
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.
Add:
11. At the end of the OnRun section just before the Reopen section begins:
Add:
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:
14. Close the C/AL Locals window to return to the C/AL Editor.
15. In the Reopen section:
After:
Add:
After:
WhseSalesRelease.Reopen(SalesHeader);
Add:
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.
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.
No changes are required for codeunit 86 for adapters for Dynamics NAV 2013
R2, Dynamics NAV 2015, Dynamics NAV 2016, and Dynamics NAV 2017.
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
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. On the Functions tab, create a new function titled NASHandler:
l In C/AL Locals of NASHandler:
o Add the following parameter
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;
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:
l Trigger Function 2
OnDatabaseInsert (RecRef : RecordRef)
After:
ChangeLogMgt.LogInsertion(RecRef);
IntegrationManagement.OnDatabaseInsert(RecRef);
Add:
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:
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:
xRecRef RecordRef
After:
ChangeLogMgt.LogModification(RecRef);
IntegrationManagement.OnDatabaseModify(RecRef);
Add:
l Trigger Function 4
OnDatabaseDelete
After:
ChangeLogMgt.LogDeletion(RecRef);
IntegrationManagement.OnDatabaseDelete(RecRef);
Add:
l Trigger Function 5
OnDatabaseRename (RecRef : RecordRef;xRecRef :
After:
ChangeLogMgt.LogRename(RecRef,xRecRef);
IntegrationManagement.OnDatabaseRename(RecRef,xRecRef);
Add:
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.
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.
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
Window.UPDATE(1,STRSUBSTNO(Text007,"Document
type","No.",SalesInvHeader."No."));
//*****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.
To Edit Codeunit 80
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:
12. Save and close C/AL Globals. You return to the C/AL Editor.
13. In the OnRun section:
After:
Add:
//*****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.
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.
Add:
11. At the end of the LinesWereModified section just before the Reopen section begins:
Add:
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:
14. Close the C/AL Locals window to return to the C/AL Editor.
15. In the Reopen section:
After:
Add:
After:
WhseSalesRelease.Reopen(SalesHeader);
Add:
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.
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:
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.
Importing default validation rules varies by version of Dynamics NAV. Click the link for
your version to view step-by-step instructions.
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-
The default validation setup file is located under the following path:
..\Microsoft Dynamics
NAV\60\ApplicationServer\ScribeModifications\Common.
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.
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.
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.
Column Name
Option Description
Operation
Operation Operation that invokes the custom validation behavior. Choose
Insert, Modify, or InsertAndModify.
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:
Fields To Validate
SetFields Only invoke the OnValidate() method associated with the fields
that are set by Scribe.
Column Name
Option Description
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.
l "I" — INSERT
l "U" — UPDATE
l "OP" — INSERT on inserts or UPDATE on updates
For example:
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.
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.
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.
Adapter-Only Release
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.
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
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 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.
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.
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.
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.
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.
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:
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.
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.
When creating the publisher, three publisher message queues are created on your
Scribe server. The queue names use this format:
SCRIBESERVERNAME\Private$\NAVSERVERNAME_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.
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:
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.
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.
and
modifiedon >= :LastRunDateTime
modifiedon < :ThisRunDateTime
modifiedbyname <> ”NavUser”
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""
".
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.”
To open the Query Condition dialog box, in the Configure Source dialog box, on the Filters
tab, click Add Condition.
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.
l 2009 R2
l 2013
l 2013 R2
l 2015
l 2016
l 2017
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.
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:
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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:
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 PostSalesOrder — The action executes posting of a sales order and has the
OrderNoToPost input and PostedInvoiceNo output parameters.
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.
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.
The following table displays the global variables defined for the ConvertSalesQuote custom
action.
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.
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.
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 following table provides local variables defined for this procedure.
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.
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.
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.
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:
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.
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'
5. As each statement is executed, the table names are updated in the Scribe Internal
Database.
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.
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.
Be sure to back up the Scribe Internal database and the collaboration root
folder regularly.
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.
In the Scribe Console, right-click the Integration Server node and click Resume
All Integration Components.
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