Advertisements

Microsoft Dynamics NAV 2018 Licenses

You have the choice of purchasing Microsoft Dynamics NAV licenses up front, or paying a monthly fee to a service provider.

Perpetual Licensing:

  • You pay affordable upfront starting price, rapid start tools and built in functionality.
  • You license the ERP Solution functionality, and access to that functionality is secured by licensing users.

 

Perpetual License Overview

Service Provider’s Subscription Licensing:

  • You have choice to keep the upfront cost to a minimum through a “per user per month” licensing fee.
  • This helps get started with a low initial cost while leveraging the built-in functionality and rapid start tools.

 

In both licensing models

You have the choice of two Concurrent-user types –

  1. Limited User (Full Read & Limited Write)
  2. Full User (Full Read & Full Write)

Option to give those users access to advanced functionality through the “Extended Pack.”

Starter and Extended Pack License Overview

Starter Pack (Base Pack – Required)

The Starter Pack offers for one price.

  • Core Financials
  • Distributions
  • Professional Services functionality
  • 3 Full User licenses/ Concurrent CALs included
  • Additional Software licenses may be required, like Server, SQL, Office 365, SharePoint. Additional Software must be licensed according to the applicable license terms.

For many businesses, this is the only license component required.

 

Extended Pack (Optional)

The Extended Pack enables customers to integrate core financials and distribution management with broader functionality extensions such as:

  • Manufacturing to support and control the manufacturing environment
  • Warehousing to manage the warehouse to support operations
  • The first three Full Users included in the Start Pack and coming users get to access to all of the incremental functionality.
  • Starter Pack is the prerequisite to the Extended Pack

 

Packaging of Functionality

A Microsoft Dynamics NAV customer can choose whether to deploy the Starter and Extended Pack through the

  • Microsoft Windows client for Microsoft Dynamics NAV
  • Web client for Microsoft Dynamics NAV
  • Microsoft Dynamics NAV Portal framework for Microsoft SharePoint (also known as the Microsoft Dynamics NAV SharePoint client)

All through the same User types.

2018 Functionality -1

 

2018 Functionality -2

Starter Pack is for companies who need

  • Core Financials
  • Trade functionality
  • Basic Financials Management (General Ledger and Fixed Assets)
  • Basic Supply Chain Management
  • Basic Sales Management (Sales, Purchasing and Inventory)
  • Professional Services (Project management)
  • A broad set of Business Insight and reporting functionality as an integral part of the product.
  • A wide range of tools to customize the solution, to meet the needs of every customer together with deep integration opportunities to be made through web services.

 

Extended Pack is for growing, midmarket, or high-functional-needs companies who are looking for an adaptive solution with a broad set of functionality:

  • Warehousing
  • Manufacturing
  • It comes with additional customization objects for doing more extensive customizations.

 

CONFIGURATION AND DEVELOPMENT

Page Designer

  • Change existing pages and enables you to create 100 page objects (included and numbered from 50,000 to 50,099).
  • The Page Designer also enables you to use the Navigation Pane Designer. This means, for example, that you can create new menu items.
  • This module does not include access to C/AL from pages.

Report Designer

  • Change existing reports and create 100 new report objects (numbered from 50,000 to 50,099).
  • This module provides access to C/AL (the C/SIDE application language) from reports used for defining special calculations and business rules.
  • Create new reports from scratch or copy an existing report to use as a starting point.
  • This module enables you to take advantage of the functionality included for developers in the Navigation Pane Designer (for example, creating new menu items).

Table Designer

  • Change existing table definitions and create ten new tables (numbered from 50,000 to 50,009).
  • You can change properties on fields, such as the field name, decimal places, and maximum value, add new fields to existing tables, and create new tables to store data specific to your business.
  • Create keys for sorting information and change or create new FlowFields and FlowFilters for “slicing and dicing” information in new ways.
  • This module does not include access to C/AL from tables.

XMLports (100)

  • Create new or change existing XMLport objects.
  • XMLport Designer provides access to C/AL (the C/SIDE application language) from XMLports used for defining special calculations and business rules.
  • Every XMLport object in Microsoft Dynamics NAV is created using this tool and can therefore be customized easily.
  • This module enables you to create 100 new XMLport objects (numbered from 50,000 to 50,099) and to take advantage of the functionality included for developers in the
  • Navigation Pane Designer (for example, creating new menu items).

Query Designer

  • The Query Designer provides the ability to modify existing queries in the application, as well as create up to 100 new queries.
  • The Query Designer is the main tool for creating objects of the type Query.
  • Query objects retrieve subsets of data spread across the database and are data pumps for various places within the application such as charts and business logic.

 

Application Builder (A la carte)

  • Change the business rules and special calculations that work behind the scenes. Business rules and special calculations are defined in C/AL (the C/SIDE application language).
  • Although this granule includes access to C/AL, it does not permit access to existing C/AL code that updates write-protected tables (for example, postings).
  • With Application Builder, you can create entirely new areas of functionality for your application, enabling you to tailor Microsoft Dynamics NAV to fit your entire organization.
  • It also enables you to create 100 codeunit objects (numbered from 50,000 to 50,099).
  • You can also take advantage of the functionality included for developers in the Navigation Pane Designer (for example, creating new menu items).

 

Solution Developer (A la carte)

  • Change the business rules and special calculations that work behind the scenes. Business rules and special calculations are defined in C/AL (the C/SIDE application language).
  • This module provides access to code that updates write-protected tables to the Merge and Upgrade Tools.
  • You can also Change or create any object type, Use the menu options Translate/Export and Translate/ Import in the Object Designer.

(These options are not available with the Application Builder module).

 

Application Objects

Codeunits (100)

  • 10 Codeunits are included in the Starter Pack
  • 10 Codeunits are included in the Extended Pack.
  • Additional groups of 100 are available in the Customization suite.

Reports (100)

  • Additional groups of 100 are available in the Customization suite.

Tables (10)

  • 10 tables are included with the Extended Pack.
  • Additional groups of 10 are available in the Customization suite.

XMLports (100)

  • 100 XMLports are included with the Extended Pack.
  • Additional groups of 100 are available in the Customization suite.

Queries (100)

  • Additional groups of 100 are available in the Customization suite.

Pages (100)

  • 100 Pages are included with the Extended Pack.
  • Additional groups of 100 are available in the Customization suite.

 

For more details you can check here.

 

 

 

 

Advertisements

Publishing the Jet Data Source Codeunit to the Web Service

Microsoft Dynamics NAV 2015 includes a “Jet Data Source” codeunit which must be published to enable Jet Essentials or Jet Express to operate. This can be published using the Microsoft Dynamics NAV Role Tailored Client (RTC).

To publish this code unit, inside the RTC go to Departments > Administration > IT Administration > General and select Web Services.

JetExcel-4
Publish the Jet Data Source code unit by selecting New from the Web services ribbon

  • Object Type: Codeunit
  • Object ID: 14125500
  • Service Name: Jet Data Source
  • And check the box to publish.
  • Click OK

Checkout Upcoming posts for more information.

Adding a Test to a Test Runner Codeunit

How to add a line to test runner codeunit that runs the new TestVendorDiscount codeunit.

The test runner codeunit runs all the test codeunits that you may have created to test the other customized functionality.

To add a test to a test runner codeunit

  • In the development environment, on the Tools menu, choose Object Designer.
  • In Object Designer, choose Codeunit, select the existing test runner codeunit, and then choose the Design button.
  • In the C/AL Editor, in the OnRun function, add the following code.

CODEUNIT.RUN(CODEUNIT::TestVendorDiscount);

  • On the File menu, choose Save.

For more details see below posts:

Creating a Test Codeunit and Test Function
Creating a Test Runner Codeunit

Creating a Test Runner Codeunit

Follow below Steps to Create Test Runner

  • In the development environment, on the Tools menu, choose Object Designer.
  • In Object Designer, choose Codeunit, and then choose New.
  • On the View menu, choose Properties.
  • In the Properties window, in the Subtype field, select TestRunner to specify that this is a test runner codeunit.
  • In the TestIsolation field, specify which changes to that you want to roll back. You can choose from the following values:
    • Disabled
    • Codeunit
    • Function

TestCu-5

Value Description
Disabled Do not roll back any changes to the database. Tests are not isolated from each other.This is the default value.
Codeunit Roll back all changes to the database after each test codeunit executes.
Function Roll back all changes to the database after each test function executes.

It is recommend that you design tests to be independent of each other. Tests might read from and write to the same database, which means that tests can interact with each other.

If tests interact, then you may experience incorrect test results.

To eliminate test interactions, use the TestIsolation property to roll back changes to the database after each test function or after each test codeunit.

If you specify that you want to roll back database changes, then all database changes are rolled back, including changes that were explicitly committed to the database during the test by using the COMMIT function.

  • In the C/AL Editor, in the OnRun function, enter code to run the test codeunits. For example, the following code in the OnRun function of a test runner codeunit runs test codeunits.

CODEUNIT.RUN(CODEUNIT::TestVendorDiscount);

Note
You may want to define your test suite in a table and then write code in the OnRun function of the test runner codeunit to iterate through items in the table and run each test codeunit.
  • (optional) To create an OnBeforeTestRun trigger, do the following steps:
    • On the View menu, choose C/AL Globals.
    • In the C/AL Globals window, on the Functions tab, on a new line in the Name field, enter OnBeforeTestRun, and then choose Locals.
    • In the C/AL Locals window, on the Parameters tab, enter the following.

TestCu-6

    • In the C/AL Locals window, on the Return Value tab, enter the following

TestCu-7

    • Close the C/AL Locals window.
    • In the C/AL Editor, in the OnBeforeTestRun trigger, enter code that executes before each test function. Typically, the code in the OnBeforeTestRun function determines if the test function should execute and returns true if it should. Otherwise, the trigger returns false. The OnBeforeTestRun trigger may also initialize logging variables. For example, the following code initializes a logging variable and returns true to indicate that the test function should execute. This example requires that you create the following global variable.

TestCu-8

  • (optional) Do the following steps to create an OnAfterTestRun trigger:
    • On the View menu, choose C/AL Globals.
    • In the C/AL Globals window, on the Functions tab, on a new line in the Name field, enter OnAfterTestRun, and then choose Locals.
    • In the C/AL Locals window, on the Parameters tab, enter the following.

TestCu-9

    • Close the C/AL Locals window.
    • In the C/AL Editor, in the OnAfterTestRun trigger, enter code that executes after each test function. For example, the following code logs the results of the tests to the test reporting system. This example requires that you create a record variable named log.

TestCu-10

TestCu-11

log.INIT;

log.UnitId := CodeunitId;

log.Unit := CodeunitName;

log.Func := FunctionName;

log.Before := Before;

log.After := CURRENTDATETIME;

If Success THEN

log.Status := log.Status::Success

ELSE BEGIN

log.Status := log.Status::Failure;

IF FunctionName <> ” THEN

log.Message := GETLASTERRORTEXT;

END

log.INSERT(true);

Note

If you implement the OnAfterTestRun trigger, then it suppresses the automatic display of the results message after the test codeunit runs.

  • On the File menu, choose Save.
  • In the Save As window, in the ID field, enter an ID and in the Name field, enter a name for the codeunit. Verify that the Compiled check box is selected, and then choose OK.

For more details see also below posts:

Creating a Test Codeunit and Test Function
Adding a Test to a Test Runner Codeunit

Creating a Test Codeunit and Test Function

Let’s creates the test function, which tests the Purch-Calc.Discount functionality, to this test codeunit.

To create the test codeunit and test function

  • In the development environment, on the Tools menu, choose Object Designer.
  • In Object Designer, choose Codeunit, and then choose New.
  • On the View menu, choose Properties.
  • In the Properties window, in the Subtype field, select Test to specify that this is a test codeunit.
  • On the View menu, choose C/AL Globals.
  • In the C/AL Globals window, on the Functions tab, enter CalculateVendorDiscount. This is the name of the test function.

TestCU-1

Note
By default, functions that you add to test codeunits have the FunctionType property set to Test.
  • On the Functions tab, choose Locals.
  • In the C/AL Locals window, on the Variables tab, enter the following variables, which you will use in the CalculateVendorDiscount test function.

TestCU-2

Important

Be sure to create these variables on the Variables tab, not on the Parameters tab. If you create them on the Parameters tab, then you get an error when you compile that says the test method signature is invalid

  • In the C/AL Locals window, on the Text Constants tab, in the Name field, enter VendorDiscountError. In the ConstValue field, enter Vendor Discount Error – Line Amount: %1, Discount: %2, Discount Amount: %3.

TestCU-3

  • Close the C/AL Locals window and the C/AL Globals window.
  • In the C/AL Editor, in the CalculateVendorDiscount function, enter the following code.

TestCU-4

You can copy above code from below:

Discount := RANDOM(99) + 1; // Set Discount > 0, <= 100

// Find purchase line.

PurchaseLine.SETFILTER(“Line Amount”, ‘>0’);

PurchaseLine.SETFILTER(“Allow Invoice Disc.”, ‘=%1’, TRUE);

IF NOT (PurchaseLine.FINDFIRST) THEN

ERROR(‘No Purchase Line found for the Calculate Vendor Discount test’);

// Create vendor discount.

WITH PurchaseLine DO BEGIN

IF NOT (VendorDiscount.GET(“Buy-from Vendor No.”, “Currency Code”, “Line Amount”)) THEN BEGIN

VendorDiscount.INIT;

VendorDiscount.Code := “Buy-from Vendor No.”;

VendorDiscount.VALIDATE(“Currency Code”,”Currency Code”);

VendorDiscount.VALIDATE(“Minimum Amount”,”Line Amount”);

VendorDiscount.INSERT(TRUE);

END;

END;

VendorDiscount.VALIDATE(“Discount %”, Discount);

VendorDiscount.MODIFY(TRUE);

// Run codeunit “Purch.-Calc.Discount” for calculating discount.

PurchCalcDisc.RUN(PurchaseLine);

PurchaseLine.GET(PurchaseLine.”Document Type”,PurchaseLine.”Document No.”,PurchaseLine.”Line No.”);

// Validate purchase discount amount

WITH PurchaseLine DO BEGIN

IF NOT (ROUND(“Line Amount” * Discount / 100) = “Inv. Discount Amount”) THEN

ERROR(VendorDiscountError, “Line Amount”, Discount, “Inv. Discount Amount” );

END;

The code in this test function prepares the test data by setting a random discount amount, getting a record from the Purchase Line table that satisfies two filters, and creating a record in the Vendor Invoice Disc. table with the random discount amount.

Next, it runs the Purch-Calc.Discount codeunit, which contains the code that is being tested. Finally, it validates the results of running the Purch-Calc.Discount codeunit and raises an error if the results are not as expected.

Note

This test code does not guarantee that the state of the database after you run the test is the same as the state of the database before you run the test.

  • On the File menu, choose Save.
  • In the Save As window, in the ID field, enter ID. In the Name field, enter TestVendorDiscount. Verify that the Compiled check box is selected, and then choose the OK button.

Now create additional test functions in the TestVendorDiscount test codeunit to test other aspects of vendor discounts.

These test functions should include negative tests, which validate that the code being tested works as intended under failing conditions.

For more details See below posts:

Creating a Test Runner Codeunit
Adding a Test to a Test Runner Codeunit

Data Upgrade Codeunit in Navision 2015 – Part -2

We have seen how to create Upgrade code unit in our previous post.

Please go through it, if not seen earlier the Data Upgrade Codeunit in Navision 2015 – Part -1 here 

Let us continue from where we left our previous post.

We have created the Upgrade code unit to copy the data to upgrade table while performing destructive changes to My Sales Customer table.

We removed certain fields from the My Sales Customer table and the related information was moved to UPG My Sales Customer table.

Now it’s time to move these information to actual table we create for this purpose My Detailed Customer Entry table.

Although in this example this table will be exact copy of UPG My Sales Customer table, so simply we need to copy records to My Detailed Customer Entry table.

But some time we may require to add certain more field’s value while moving the data Like Entry No, Posting date to maintain the data integrity. Like think of some Service type of information you are maintaining then the same set of record may repeat number of times on different dates, then in this case we will require to add certain fields like Entry No. and Posting Dates.

Let us assume we will be maintain data of My Detailed Customer Entry in incremental way as of situation on every transaction. Balances will be maintained as of when transaction was performed.

Although this example is not feasible or practice but still we are continuing to just see how to write Upgrade Function for such purpose.

Our today’s task is to design and run data upgrade function to move data from the upgrade table to its new location.

Now the fields are deleted from the My Sales Customer table and the data is saved in the UPG My Sales table. The next step is to create the new table where the data will reside (My Detailed Customer Entry) and move the data into that table.

Let’s create the table to be used for recording of all future Customer Balances and to accommodate the data we already had in the My Sales Customer table and which we moved into the UPG My Customer table.

  • In the Object Designer select the Tables button and then select New button to create a new table
  • Define the table layout based on the layout shown in the Screenshot.

Upgrade Codeunit 2 - 1

  • In the Dev. Environment menu, select File-Save action to save the table.
  • On the Save dialogue, define ID, Name = My Detailed Customer Entry, and select OK to save the table.
  • Close the table editor.

We will now create a new function which will contain the code to migrate the data from the upgrade table to the new table.

Note that the FunctionType property of the newly created function is set to “Upgrade”. This is how the NAV server can later figure out which function from the upgrade codeunit it must execute.

The function marked as “Upgrade” function can call functions marked as “Normal” if necessary.

  • In the Object Designer select the Codeunits button, select codeunit 50000 UPGTK Codeunit and then select the Design button.
  • In the Dev. Environment menu, select View-C/AL Globals action and in the form which is opened select the Functions tab.
  • Enter the name of the function, e.g. UpgradeCustomerDetails

Upgrade Codeunit 2 - 2

  • Select the UpgradeCustomerDetails function on the Functions tab and then select the Locals button to define function parameters.
  • On the C/AL Locals form, select Variables tab and add 3 local variables as shown in the Screenshot section.
  • Close the C/AL Locals and C/AL Globals forms to return to the C/AL Editor.

Upgrade Codeunit 2 - 3

The code we add to the UpgradeCustomerDetails function will copy the data from the UPG My Sales Customer table to the My Detailed Customer Entry table and then clean up the UPG Vehicle table.

  • Code like the Screenshot into the UpgradeCustomerDetails function.

//>> Upgrade Code

EntryNo := 1;

WITH UpgCustomer DO BEGIN

IF FINDSET THEN

REPEAT

DetailedCustomerEntry.INIT;

DetailedCustomerEntry.”Entry No.” := EntryNo;

DetailedCustomerEntry.”Customer No.” := “Customer No.”;

DetailedCustomerEntry.”As of Date” := today;

DetailedCustomerEntry.”Last SO Value” := “Last SO Value”;

DetailedCustomerEntry.”Last Invoiced Value” := “Last Invoiced Value”;

DetailedCustomerEntry.”Total Outstanding Value” := “Total Outstanding Value”;

DetailedCustomerEntry.INSERT;

EntryNo := EntryNo + 1;

UNTIL NEXT = 0;

DELETEALL;

END;

//<<Upgrade Code

  • In the Dev. Environment menu, select File-Save action to save the codeunit.
  • On the Save dialogue select OK button.
  • Close the codeunit editor.

Upgrade Codeunit 2 - 4

  • In the Dev. Environment menu select Tools – Data Upgrade – Start… action.
  • Agree to the confirmation dialogue.
  • In the Start Data Upgrade window select the OK button.

You can start the data upgrade process from the Dev. Environment, or from Microsoft Dynamics NAV 2015 Administration Shell, using Start-NAVDataUpgrade cmdlet.

The NAV server will locate all upgrade codeunits and will invoke all upgrade functions within these codeunits for all companies in the database.

If you have multiple upgrade functions in your upgrade codeunit, you can choose to execute them in parallel or in sequence. You can also choose to stop at first error, or continue execution of other functions, see the list of all failed ones, fix them and start them again using the Data Upgrade – Resume… action.

  • In the Dev. Environment menu select Tools – Data Upgrade – Start… action.
  • Agree to the confirmation dialogue.
  • In the Start Data Upgrade window select the OK button.

Upgrade Codeunit 2 - 5

Upgrade Codeunit 2 - 6

  • In the Object Designer select the Tables button, then select table My Detailed Customer Entry and select Run button

Upgrade Codeunit 2 - 7

You can see that the data from the upgrade table was successfully transferred into the new table.

Now since our data is sitting in its right place, now we can remove objects we are using for Upgrade purpose.

Now the data upgrade is completed and we need to remove the objects used within that process.

Force-delete the upgrade table, since the data was already transferred into the new table.

Delete the upgrade codeunit to make sure the old synchronization instructions defined in it are not used by the NAV server when you decide to change the My Sales Customer table again. Alternatively (if you want to reuse the upgrade codeunit later) you can choose to change the type of the GetTableSynchSetup function to “Normal”.

Upgrade Codeunit 2 - 8

Now we are done with our Upgrade project.

Conclusion

This set of demonstrations have provide you the insight, new way of running the data upgrade in Microsoft Dynamics NAV 2015 by involving the schema synchronization and upgrade codeunits.

The new approach:

  • Simplifies the upgrade environment, since all steps are performed by the latest version of the product.
  • Increases the data upgrade performance, since it is possible to parallelize execution of the data upgrade functions within the upgrade codeunit and across companies.
  • Reduces the amount of code to be written to handle the data upgrade, since some actions are now executed automatically by the NAV Server.
  • Allows data upgrade to be invoked by the NAV server, minimizing the number of manual actions which should be performed during the data upgrade.
  • Uses familiar upgrade toolkit design concepts (e.g. upgrade tables, upgrade functions).

Data Upgrade Codeunit in Navision 2015 – Part -1

Let us start with background preparation.

I have prepared a table with below fields and filled with some sample data.

DataUpgradeCU-1

Fill in the My Sales Customer table with demo data.

Make sure you have data in all columns, preferably create several records in this table.

Now when the fields are deleted from the My Sales Customer Table and the data is saved in the UPG My Sales Customer table, we will create the new table where the data will reside in the new version (My Detailed Customer Entry) and move that data into that table using Data Upgrade action in the Dev. Environment.

Since now my project requirement is to refactor the My Sales Customer table and delete the fields which store the information about the Sales Information (“Value” fields), we need to create an intermediate upgrade table where the data from those fields will be stored until you move it into the new My Detailed Customer Entry table.

We will perform below action:

  • Open the Object Designer and select table My Sales Customer
  • Select the Design button to open the table in the designer.
  • In the Dev. Environment menu, select File-Save As… action.
  • Change the ID value to New ID, change the Name to UPG My Sales Customer and select OK button to close the dialogue and create a copy of the table.

DataUpgradeCU-1

  • In table UPG My Sales Customer delete fields Customer Name, Customer Type and Credit Limit.
  • In the Dev. Environment menu, select File-Save action.
  • On the Save dialogue, set the Synchronize Schema option to “Force” and  select OK button to close the dialogue.

DataUpgradeCU-1

  • In the Object Designer select the Codeunits button and then click New to start creating a new upgrade codeunit.
  • In the Dev. Environment menu, select View-Properties action to start editing the properties of the codeunit.
  • Change the Subtype property to Upgrade and close the Properties form.

DataUpgradeCU-1

  • In the Dev. Environment menu, select View-C/AL Globals action and in the form which is opened select the Functions tab.
  • Enter the name of the function, e.g. GetTableSyncSetup
  • In the Dev. Environment menu, select View-Properties action to start editing the properties of the function.
  • Change the FunctionType property to TableSyncSetup and close the Properties form.

DataUpgradeCU-1

  • Select the GetTableSyncSetup function on the Functions tab and then select the Locals button to define function parameters.
  • Add a parameter of DataType = Record, Subtype = Table Synch. Setup, Name = TableSynchSetup, Var = Yes.

DataUpgradeCU-1

  • On the C/AL Locals form, select Variables tab and add a local variable of DataType = Codeunit, Subtype = Data Upgrade Mgt.
  • Close the C/AL Locals and C/AL Globals forms to return to the C/AL Editor.

DataUpgradeCU-1

  • In the GetTableSyncSetup function, add the C/AL statement as presented on the screenshot.
  • In the Dev. Environment menu, select File-Save action to save the codeunit.
  • On the Save dialogue, define ID , Name = UPGTK Codeunit, and select OK to save the codeunit.
  • Close the codeunit editor.

DataUpgradeCU-1

[

//>>Data Upgrade Code

// To copy data from table My Sales Customer to UPG My Sales Customer table

DataUpgradeMgt.SetTableSyncSetup

(

DATABASE::”My Sales Customer”,

50002,

TableSynchSetup.Mode::Copy

);

//<<Data Upgrade Code

]

  • In the Object Designer, select the Tables button and then select the My Sales Customer table in the list of tables.
  • Click Design to open the table in the table designer.
  • Delete the following fields:
  • Last SO Value
  • Last Invoiced Value
  • Total Outstanding Value
  • In the Dev. Environment menu, select File-Save action.
  • On the Save dialogue, notice that the Synchronize Schema option is set to “Now – with validation” and select OK button to close the dialogue.

DataUpgradeCU-1

  • In the Object designer, find table UPG My Sales Customer and click Run to check if the data was copied there by the schema synchronization.

DataUpgradeCU-1

Here we are now done with the Part -1 of our exercise. Next step is to move this temp data in respective table as part of our Upgrade. We will see upgrade part in our next post.

Schema Synchronization in Microsoft Dynamics Navision 2015

NAV 2015 provides you with flexibility of deciding when and how your table changes should be synchronized with corresponding SQL tables.

What is table synchronization?

SchemaSync-1

NAV 2013 R2:- Schema synchronization executes automatically on any connection to the Server.

NAV 2015:- Schema synchronization executes on demand by the Server.

Way the Synchronization works:

  1. Per Table Synchronization
  2. Synchronizing schema changes for all tables

SchemaSync-2

Now let us see how it works:

SchemaSync-3

Add/Modify/Delete Fields (change table definition) we will be prompted for Synchronizing the Schema.

It gives three options description is self-explanatory.

Some time we have to do major changes to the tables which takes lots of time to sync, we can postpone the sync process by selecting Later. Once we are done with all of our changes we can go with synchronization in one go.

SchemaSync-4

We get same options.

New option Check Only….

SchemaSync-5

This option will only report outcome and will not Sync the Schema.

Since we have just added new field so no risk as reported by above check.

Now I will delete one field from the table and let’s see what result comes.

SchemaSync-6

Summary of the 3 options as below:

SchemaSync-7

When data loss is reported while changes in table definition is referred as destructive changes.

SchemaSync-8

You use upgrade codeunits when you make changes to a table definition, either from the Microsoft Dynamics NAV Development Environment or during an upgrade. Upgrade codeunits migrate existing business data from the old table structure into the new table structure. An upgrade codeunit serves the following purposes:

  • Provides instructions for how to handle data changes to a table during schema synchronization.
  • Provides the logic for migrating existing data in the business data table from the old format to the new format after schema synchronization.

A typical example of when to use an upgrade codeunit is when you remove a field from a table definition and you do not want to lose the existing data in the business data table. Instead, you want to use it somewhere else in the new application.

You implement upgrade codeunits when you make destructive changes to tables in Microsoft Dynamics NAV Development Environment. After you have created an upgrade codeunit to handle table changes, you can use it when you upgrade data from an earlier version of Microsoft Dynamics NAV to the current version. A single upgrade codeunit will typically contain table schema synchronization instructions and data migration logic for multiple tables that have changed from one version of Microsoft Dynamics NAV to another.

SchemaSync-9

I will come back on this topic in another post with more details.

And many more options like PowerShell Sync with above options.

Benefits:-

Perform on demand – transparency -> As developer and system administrator, you are in control when to call the schema synchronization and how to synchronize table changes. You can invoke it, plan for it and schedule for it on a case by case basis. You can also monitor its progress and monitor the state of your database (tenant).

Not blocking other changes – productivity -> Schema Synchronization has become more granular. It can be performed per table object as well as for all table changes at once. When one table is being synchronized you are no longer blocked, and you can continue making changes to other tables.

Opened for additional instructions – flexibility -> Using upgrade codeunits you can provide input for the schema synchronization to do extra tasks, like automatically moving or copying data into upgrade tables, checking the changes or forcefully applying them where necessary. (Will come up with more details on this in my next post)

Important

Most of the contents you find in this blog will be either inherited from MSDN or Navision Developer IT Pro Help. Some places images are also directly taken from these sites. Purpose is simple to try those stuffs and re-produce adding few things as per my understanding to make easy understanding for others and quick reference.

Here nothing under my own brand or authorship of the content. At any point of time we are just promoting Microsoft stuffs nothing personnel with same.

Hope stuffs used here will not violate any copyright agreement with them. In case by mistake or in-intestinally it happens and the Microsoft feels these should not be used Microsoft have full right to inform me about same and will be glad to take down any such content which may be violating the norms.

Purpose is to promote Navision and share with community.

FB Profile

Like FB Page

%d bloggers like this: