• Microsoft Dynamics NAV Team Blog

    Using the Quick Filter in Microsoft Dynamics NAV

    • 10 Comments

    Many of you that have installed Microsoft Dynamics NAV 2013 R2 have for sure noticed that the quick filter behavior has been redesigned in this release and that is why, in this post, we will go through all the changes and the intention behind them.

     

    So let’s start with a bit of history; the first version of the quick filter was released in the Microsoft Dynamics NAV 2009 Windows client, where we replaced the filter window available in the development environment with a filter pane integrated on all Microsoft Dynamics NAV pages. Here the user both has the option of entering filter criteria as plain text and the ability of composing an advanced filter. If you would like to quickly search for a certain record, the recommended practice is to use the quick filter.

    Let’s say, for example, that we want to find a contact in the contact list starting with “Man”. We can construct the filter by selecting the Name field and entering the text “man” in the search field.

    Notice that all the contacts starting with “man” now appear in the results list. How is this working? Whatever we add to this filter will be internally translated to a string by adding ‘@’ in front and ‘*’ in the end. So our filter string ‘man’ becomes ‘@man*’ and the Windows client filters for any contact name that starts with “man” in upper or lower case.  

    The following table illustrates more Quick Filter search examples in Microsoft Dynamic NAV 2013.

    Search Criteria

    Interpreted as…

    Returns…

    Man

    @man*

    All records that start with the string man and case insensitive.

    Se

    @se*

    All records that start with the string se and case insensitive.

    Man*

    Starts with Man and case sensitive

    All records that start with the string Man

    'man'

    An exact string and case sensitive

    All records that match man exactly

    *1

    Ends with 1

    All records that end with 1

    @*man

    Ends with and case insensitive

    All records that end with man

    @man*

    Starts with and case insensitive

    All records that start with man

    As part of our development process we regularly perform usability studies and some of them showed the users instinctively thought of the quick filter as a search field and that is why we decided to modify the quick filter behavior to a “contains” rather than a “starts with”. So what does this mean?

    Let’s construct the same filter in the Microsoft Dynamics NAV 2013 R2. Notice that the search results list includes contact names which start with “Man” and even have “Man” in the middle of the name. 

    What has changed? The entered filter will be translated to a string by adding ‘@*’ in front and ‘*’ in the end. So our filter string ‘man’ becomes ‘@*man*’ and the Windows client filters for any contact name that contains “man” in upper or lower case.  

    To start with in the RTM version of Microsoft Dynamics NAV 2013 R2 we have considered the simple user approach where the special characters in the filter criteria are ignored. However, in the Cumulative Update 13 for Microsoft Dynamics NAV 2013, we have refined the user experience and now respect the entered filter criteria.

    The following table illustrates the Quick Filter search examples for the Cumulative Update 13 and later for Microsoft Dynamics NAV 2013.

    Search Criteria

    Interpreted as…

    Returns…

    Man

    @*man*

    All records that contain the string man and case insensitive.

    Se

    @*se*

    All records that contain the string se and case insensitive.

    Man*

    Starts with Man and case sensitive

    All records that start with the string Man

    'man'

    An exact string and case sensitive

    All records that match man exactly

    *1

    Ends with 1

    All records that end with 1

    @*man

    Ends with and case insensitive

    All records that end with man

    @man*

    Starts with and case insensitive

    All records that start with man

    We encourage you to check out the Cumulative Update 13 and we hope that this blog demystifies some of the behavioral differences of the quick filter across Microsoft Dynamics NAV product versions.

  • Microsoft Dynamics NAV Team Blog

    Zetadocs Express zero-client install option: One add-in for all

    • 0 Comments

    It’s becoming less desirable to install any client side software and ease of deployment is becoming a key factor when choosing software. Modern software needs hybrid options and using deployment methods like ClickOnce, it looks likely to remain that way - for a while longer at least.

    Equisys has now released an update to Zetadocs Express that includes the option of a Document FactBox installed on the server than runs Microsoft Dynamics NAV server to support the Microsoft Dynamics NAV Web client. It is also automatically available to the Microsoft Dynamics NAV Windows client, deployed remotely using ClickOnce, and Microsoft Dynamics NAV Windows clients that are installed directly on the desktop. This cross-client support now gives partners the option of zero client-side software deployment to achieve simple document management across all Microsoft Dynamics NAV clients.

    Touch and Choose

    One of the main benefits of Zetadocs Express is the ability to drag and drop related documents which are stored in the electronic archive for viewing in context within Microsoft Dynamics NAV. However, drag and drop to capture is very much a Windows invention for enhanced usability.

    A Microsoft Dynamics Web client in a browser on a tablet makes that more complicated, especially when you want to drag and drop emails and attachments from Outlook to Microsoft Dynamics NAV records. That sort of action - between two separate programs - is just not possible yet in the web world, especially with most touch devices.

    Consequently touch and choose was born as the way to add documents in the Microsoft Dynamics NAV Web client, which works just as well irrespective of the device you happen to be using.

    Coexistence

    If PC-based users using the Microsoft Dynamics NAV Windows client want the ability to capture emails using drag and drop from Outlook they can with an additional client-side install.

    The Zetadocs Document FactBox detects whether the Zetadocs Client is installed locally on the desktop, and if so it automatically shows the additional drag and drop functionality and Outlook email integration.

    Both add-ins happily coexist in the same Microsoft Dynamics NAV system - you just need to decide if the additional functionality is needed by the client and install Zetadocs Client on those desktops that need it.

    Try it today

    Zetadocs Express is the foundation member of the Zetadocs for the Microsoft Dynamics NAV family of products available at no additional cost to users of Microsoft Dynamics NAV 2013 & Microsoft Dynamics NAV 2009 on a Business Ready Enhancement Plan, download it and try it with the Microsoft Dynamics NAV 2013 R2 Web client today!

  • Microsoft Dynamics NAV Team Blog

    Journal Error Processing

    • 0 Comments

    Today’s pattern changes the paradigm of how we’ve done error processing in Microsoft Dynamics NAV earlier by providing less-intrusive, more user-productive error processing.

    Meet the Pattern

    This pattern describes an optimized way to handle invalid, incomplete, or inconsistent data that users enter in journals.

    Know the Pattern

    Scenario: A user has entered data on a journal line and proceeds to invoke a processing action on it, such as posting or exporting to electronic payments. Microsoft Dynamics NAV validates the data before it is committed. If any validation errors are found, the user must be informed of validation errors in the most optimal way.

    One design is that when an error is found, stop execution and prompt the user to correct the error. After correcting the error, the user restarts processing and is stopped again at the next error, and so on. Stopping and showing each error is time-consuming and frustrating for the user.

    Another design is that processing does not stop when an error is found. Instead, all errors are gathered in a table and displayed all at once at the end of processing. This way, the processing is ideally invoked only once, reducing the time and effort spent by the user to expose and correct all data validation errors.

    In both designs, the processing is not finalized if any errors are found (for example, exporting to electronic payments is not done, until the data error is resolved).

    This document describes how to implement the second error-handling design: Showing all errors at the end.

    Use the Pattern

    The example below comes from the implementation of SEPA Credit Transfer.

    After setting up SEPA-specific configurations, the user can start entering vendor payments that will later be exported to the payment file. (The setup depends on the country, but generally involves choosing number series for SEPA export files, choosing the export format, and enabling SEPA Credit Transfer.)

    In the W1 solution (and most of the country-/region-specific versions), payment lines are created in the Payment Journal page, from where the user can invoke the Export Payments to File action, which will attempt to create a SEPA-compliant XML file containing the description of the journal payments that are to be made by the bank.

    When the Export Payments to File function is invoked, Microsoft Dynamics NAV validates the journal line data. If the data must be completed or updated, then no file will be created and the user sees the following message:

    To give a visual overview, the lines that need corrections are highlighted in red. The factbox is context-sensitive, meaning that it shows only the errors that relate to the currently selected line.

    When the first payment journal line is selected, the FactBox show errors for the first line.


    When the second payment journal line is selected, the FactBox shows errors for the second line. 


    Application Objects

    In the following table, the Generic Object column contains the objects that you can use as a base for your implementation.

    Generic Object

    Description

    Sample W1 implementation of SEPA Credit Transfer*

    Journal Page

    This is the journal list page where the user invokes the processing action.

    Payment Journal

    Action on Page

    The processing action invoked by the user on the journal list page.

    Export Payments to File

    Errors Page List Part

    A FactBox that displays any journal line validation errors.

     

    To improve user experience, the developer can highlight the lines with errors in red and conveniently sort the lines with errors at the top.

    Payment Journal Errors Part

    Validation codeunit

    Contains code that checks that the journal line contains correct, complete, and coherent data and that the line is ready for whatever process must be done next.

    SEPA CT-Check Line

    Processing codeunit

    Executes the processing of the journal lines.

    SEPA CT-Export File

    Journal Error Text Table

    Contains

    • The error messages
    • Link information about where the error messages belong. For example, in table 1228, Payment Jnl. Export Error Text, the error is linked uniquely to a journal line by the following fields:
      • Journal Template Name, with TableRelation="Gen. Journal Template"
      • Journal Batch Name, with TableRelation="Gen. Journal Batch".Name WHERE (Journal Template Name=FIELD(Journal Template Name))
      • Journal Line No.

    Other related information can be added, such as document number of the original source document, if the current journal line originates from a document.

     

    An extra improvement would be to add a drilldown or a link to the page where the user can fix the error. This would significantly simplify the scenario by excluding manual navigation and investigation by the user to find the page where the error can be fixed.

    Payment Jnl. Export Error Text

     

     * The W1 implementation of file export for SEPA Credit Transfer contains the generic SEPA functionality. However, due to differences in data models and user scenarios in various country implementations, the selected local versions contain adaptations of the generic functionality.

    Flow

    Find below a diagram describing the flow between the objects involved in the journal error processing.

    Code

    Following the flow above, the code (in the SEPA Credit Transfer example) is as follows.

    Read more on NAV Wiki...

    Best regards,

    The NAV Application Patterns team

  • Microsoft Dynamics NAV Team Blog

    Owner ID field became obsolete in Dynamics NAV

    • 0 Comments

    On MSDN it is written that the Owner ID field became obsolete and should be removed from specific pages. This means that anyone can start up the Windows Client and configure a Role Center without any restrictions. Reasoning behind this is explained in this small blog posting among a new approach that does give a better handling of this.

    The Owner ID was removed from the profile table during the multitenant work. The Profiles are in the application table and can’t have references to users which are in the tenants. The feature itself was not that well thought through. On all other records we have a last person saving wins.

    The proposed workaround / solution is to use a permission set per profile and use record level security to restrict access to that particular profile ID.

    To resolve the issue and get the old behavior back, you need to create a new Permission Set. E.g.:

    TEST PROFILE
    Following details:
    Object Type   Object ID        Object Name         R/I/M/D   Security FIlter
    Table Data     2000000072  Profile Metadata     Yes          Profile: Profile ID=ACCOUNTING MANAGER

    After logging on with a user in configuration mode that has two permission sets applied (BASIC and TEST PROFILE) with a profile called IT Manager, it is no longer possible to change the role center and make changes.

    Kindest regards,

    Marco Mels
    Microsoft Dynamics Netherlands

    Microsoft Customer Service and Support (CSS) EMEA

  • Microsoft Dynamics NAV Team Blog

    Cumulative Update 7 for Microsoft Dynamics NAV 2013 R2 has been released

    • 9 Comments

    Cumulative update 7 includes all application and platform hotfixes and regulatory features that have been released for Microsoft Dynamics NAV 2013 R2. 

    The cumulative update includes hotfixes that apply to all countries and hotfixes specific to the following local versions:

    • AU - Australia
    • AT - Austria
    • BE - Belgium
    • CH - Switzerland
    • DE - Germany
    • DK - Denmark
    • ES - Spain
    • FI  - Finland
    • FR - France
    • IS - Iceland
    • IT - Italy
    • NA - North America
    • NL - Netherlands
    • NO - Norway
    • NZ - New Zealand
    • RU – Russia
    • SE - Sweden
    • UK - United Kingdom

    Where to find cumulative update 7

    You can download cumulative update 7 from KB 2964528 – Cumulative Update 7 for Microsoft Dynamics NAV 2013 R2 (Build 36703 - our apologies for originally posting the wrong build number).

    For a full list of all hotfixes included in cumulative updates for Microsoft Dynamics NAV 2013 R2, see the following CustomerSource and PartnerSource pages: 

    CustomerSource:

    PartnerSource

    More Information

    For more information about cumulative updates for Microsoft Dynamics NAV 2013 R2, see Announcement of update rollups for Microsoft Dynamics NAV 2013 R2

  • Microsoft Dynamics NAV Team Blog

    Cumulative Update 14 for Microsoft Dynamics NAV 2013 has been released

    • 2 Comments

    Cumulative update 14 includes all application and platform hotfixes and regulatory features that have been released for Microsoft Dynamics NAV 2013. The cumulative update includes hotfixes that apply to all countries and hotfixes specific to the following local versions:

    • AU - Australia
    • AT - Austria
    • BE - Belgium
    • CH - Switzerland
    • DE - Germany
    • DK - Denmark
    • ES - Spain
    • FI   - Finland
    • FR - France
    • IS  - Iceland
    • IT   - Italy
    • NA - North America
    • NL - Netherlands
    • NO - Norway
    • NZ - New Zealand
    • SE - Sweden
    • UK - United Kingdom

    Where to find cumulative update 14

    You can download cumulative update 14 from KB 2964546 – Cumulative Update 14 for Microsoft Dynamics NAV 2013 (Build 36605).

    For a full list of all hotfixes included in the cumulative update, see the following CustomerSource and PartnerSource pages:

    CustomerSource:

    PartnerSource:

  • Microsoft Dynamics NAV Team Blog

    Using C/AL Query Objects Instead of Nested Loops

    • 5 Comments

    After a bit of a delay, here is the latest Microsoft Dynamics NAV design pattern, brought to you by the NAV Design Patterns team.

    Meet the Pattern

    This pattern shows how the new query object type introduced in Microsoft Dynamics NAV 2013 allows you to replace costly loops when inspecting data from two or more tables.

    Know the Pattern

    One of the core operations in a relational database is joining two or more tables. For example, you might need to extract all sales lines in the database together with information regarding the related sales header. This requires joining the Sales Header and Sales Line tables using Sales Header No. as the connecting field.

    The join operation has traditionally been done in C/AL by record looping. When Microsoft Dynamics NAV 2013 introduced the query object, it allowed us to produce a data set that is the result of a join operation between two or more tables. This simplifies the problem of finding related records in two tables linked through a foreign key.

    Pattern Elements

    1.       Two or more tables that contain records linked through a foreign key: Table 1, Table 2, Table n.

    2.       A query object Query X, that joins Table 1, Table 2, etc. based on the connecting key.

    3.       A processing codeunit that loops through the query records (or any other code-bearing object).

    Pattern Steps

    1.       Run the query on the connected tables.

    2.       Loop through the records returned by the query.

    3.       Process the records. 

    The following  diagram illustrates the elements of the pattern.  

    Use the Pattern

    The Bank Acc. Reconciliation Line table (274) and the Bank Account Ledger Entry table (271) are connected through the Bank Account No. field. Identify the matching pairs of records based on having the same remaining amount and transaction date.

    Solution Using Nested Loops

    The classic C/AL approach is to:

    1.       Set the necessary filters on the left table, i.e. table 274.

    2.       Loop through the filtered records.

    3.       For each record in the filter, find the related records in the right table (table 271) and set the required filters on it.

    4.       For each pair of records from the left and right table, decide if they are a solution and if so, apply them to each other.

    VAR

      BankAccRecLine@1005 : Record 274;

      BankAccLedgerEntry@1006 : Record 271;

      BankAccEntrySetReconNo@1007 : Codeunit 375;

     

    BEGIN

      BankAccRecLine.SETFILTER(Difference,'<>%1',0);

      BankAccRecLine.SETRANGE(Type,BankAccRecLine.Type::"Bank Account Ledger Entry");

      IF BankAccRecLine.FINDSET THEN

        REPEAT

          BankAccLedgerEntry.SETRANGE("Bank Account No.",BankAccRecLine."Bank Account No.");

          BankAccLedgerEntry.SETRANGE(Open,TRUE);

          BankAccLedgerEntry.SETRANGE("Statement Status",BankAccLedgerEntry."Statement Status"::Open);

          BankAccLedgerEntry.SETFILTER("Remaining Amount",'<>%1',0);

          IF BankAccLedgerEntry.FINDSET THEN

            REPEAT

              IF (BankAccRecLine.Difference = BankAccLedgerEntry."Remaining Amount") AND (BankAccRecLine."Transaction Date" = BankAccLedgerEntry."Posting Date") THEN                        BankAccEntrySetReconNo.ApplyEntries(BankAccRecLine,BankAccLedgerEntry,  Relation::"One-to-One");

            UNTIL BankAccLedgerEntry.NEXT = 0;

        UNTIL BankAccRecLine.NEXT = 0;

    END;

    Solution Using a Query

    The new query-based approach involves:

    1.       Define a query that returns the full filtered join of tables 271 and 274.

    2.       Loop through the records returned by the query.

    3.       For each query record, decide if it represents a solution and then connect the two table records that formed it through an application.

    VAR

      BankRecMatchCandidates@1001 : Query 1252;

      BankAccEntrySetReconNo@1007 : Codeunit 375;

    BEGIN

    BankRecMatchCandidates.SETRANGE(Rec_Line_Bank_Account_No,BankAccReconciliation."Bank Account No.");

    BankRecMatchCandidates.SETRANGE(Rec_Line_Statement_No,BankAccReconciliation."Statement No.");

     

    IF NOT BankRecMatchCandidates.OPEN THEN

      EXIT;

     

    WHILE ...

     

    Read more on NAV Design Patterns Wiki...

    Best regards,

    Bogdan Sturzoiu, at Microsoft Development Center Copenhagen

  • Microsoft Dynamics NAV Team Blog

    Cumulative Update 6 for Microsoft Dynamics NAV 2013 R2 has been released

    • 19 Comments

    NOTE: The term “update rollup”, which has been used until now for hotfix releases, has been replaced with the term “cumulative update”. The meaning of the term is unchanged.

    Cumulative update 6 includes all application and platform hotfixes and regulatory features that have been released for Microsoft Dynamics NAV 2013 R2. 

    The cumulative update includes hotfixes that apply to all countries and hotfixes specific to the following local versions:

    • AU - Australia
    • AT - Austria
    • BE - Belgium
    • CH - Switzerland
    • DE - Germany
    • DK - Denmark
    • ES - Spain
    • FI  - Finland
    • FR - France
    • IS - Iceland
    • IT - Italy
    • NA - North America
    • NL - Netherlands
    • NO - Norway
    • NZ - New Zealand
    • RU – Russia (NEW)
    • SE - Sweden
    • UK - United Kingdom

    Where to find cumulative update 6

    You can download cumulative update 6 from KB 2955941 – Cumulative Update 6 for Microsoft Dynamics NAV 2013 R2 (Build 36366).

    Note: Implementing this cumulative update will require a database conversion unless you have already implemented update rollup 5.

    For a full list of all hotfixes included in cumulative updates for Microsoft Dynamics NAV 2013 R2, see the following CustomerSource and PartnerSource pages: 

    CustomerSource:

    PartnerSource

    More Information

    For more information about cumulative updates for Microsoft Dynamics NAV 2013 R2, see Announcement of update rollups for Microsoft Dynamics NAV 2013 R2

  • Microsoft Dynamics NAV Team Blog

    Cumulative Update 13 for Microsoft Dynamics NAV 2013 has been released

    • 1 Comments

    NOTE: The term “update rollup”, which has been used until now for hotfix releases, has been replaced with the term “cumulative update”. The meaning of the term is unchanged.

    Cumulative update 13 includes all application and platform hotfixes and regulatory features that have been released for Microsoft Dynamics NAV 2013. The cumulative update includes hotfixes that apply to all countries and hotfixes specific to the following local versions:

    • AU - Australia
    • AT - Austria
    • BE - Belgium
    • CH - Switzerland
    • DE - Germany
    • DK - Denmark
    • ES - Spain
    • FI   - Finland
    • FR - France
    • IS  - Iceland
    • IT   - Italy
    • NA - North America
    • NL - Netherlands
    • NO - Norway
    • NZ - New Zealand
    • SE - Sweden
    • UK - United Kingdom

    Where to find cumulative update 13

    You can download cumulative update 13 from KB 2955943 – Cumulative Update 13 for Microsoft Dynamics NAV 2013 (Build 36347).

    For a full list of all hotfixes included in the cumulative update, see the following CustomerSource and PartnerSource pages:

    CustomerSource:

    PartnerSource:

    More Information

    For more information about cumulative updates for Microsoft Dynamics NAV 2013, see Announcement of new hotfix process for Microsoft Dynamics NAV 2013.

  • Microsoft Dynamics NAV Team Blog

    NAV Design Pattern of the Week - Temporary Dataset Report

    • 1 Comments

    After a short delay, here is the latest design pattern, brought to you by the Microsoft Dynamics NAV Design Patterns team.

    Meet the Pattern

    This pattern generates the data to be displayed dynamically by combing/processing several data sources. It then displays the resulting dataset without writing to the database.

     

    Know the Pattern

     

    While writing reports in Microsoft Dynamics NAV, we have the luxury of using a built-in iterator. So, once we define the dataitem and the ordering, the runtime takes care of the iteration.

     

    The iterator has one shortcoming: It can only run through records written into the database. There are situations, however, where we want to display temporary datasets created at runtime by processing data from different sources. That is where the Temporary Dataset Report pattern can be used.

     

    Use the Pattern

     

     This pattern takes a two-step approach to displaying the data:

     

    • Parse the data sources to create a record buffer in a temporary record variable.
    • Iterate through a data item of the Integer table and display one record from the temporary recordset in each iteration.

     

    Step 1: Combining data sources to create a dataset

     

    In this step, we would process the existing data to create a temporary recordset. The three most common techniques to do this are discussed in the following paragraphs.

     

    The first technique is mostly used when we want to build the report based on one or more source tables. A lot of processing is required, and we therefore want to store and display information from a temporary recordset. With this technique, we create a data item of the source record and then iterate through this data item to create the temporary recordset. An advantage of this technique is that it allows the user to perform additional filtering on the data source tables since they are added as additional data items and therefore will have their tabs on the request page by default.

     

     

    The second technique was made available with NAV 2013 when queries were introduced as a tool to help us combine data from different sources.

    Read the entire pattern on NAV Wiki...

     

    Best regards,

    Abhishek Ghosh from the Microsoft Dynamics NAV Design Patterns team

  • Microsoft Dynamics NAV Team Blog

    Update Rollup 12 for Microsoft Dynamics NAV 2013 has been released

    • 0 Comments

    Update rollup 12 for Microsoft Dynamics NAV 2013 (Build 36207) has been released.

    Update rollup 12 includes all application and platform hotfixes and regulatory features that have been released for Microsoft Dynamics NAV 2013. With update rollup 12, local hotfixes for additional countries have been added, and update rollups for Microsoft Dynamics NAV 2013 now include hotfixes that apply to all countries and hotfixes specific to the following local versions:

    • AU - Australia
    • AT - Austria (NEW)
    • BE - Belgium (NEW)
    • CH - Switzerland (NEW)
    • DE - Germany
    • DK - Denmark
    • ES - Spain (NEW)
    • FI   - Finland (NEW)
    • FR - France
    • IS  - Iceland (NEW)
    • IT   - Italy
    • NA - North America
    • NL - Netherlands
    • NO - Norway (NEW)
    • NZ - New Zealand
    • SE - Sweden
    • UK - United Kingdom

    New in update rollup 12 

    Beginning with update rollup 12, the update rollups for Microsoft Dynamics NAV 2013 now also include hotfixes for the upgrade toolkit. 

    Where to find update rollup 12

    You can download update rollup 12 from KB 2937998 - Update Rollup 12 for Microsoft Dynamics NAV 2013 (Build 36207).

    The hotfixes that have been released since update rollup 11 are listed in KB 2937998. For a full list of all hotfixes included in the update rollup, see the following CustomerSource and PartnerSource pages:

    CustomerSource:

    PartnerSource:

     More Information

    For more information about update rollups for Microsoft Dynamics NAV 2013, see Announcement of new hotfix process for Microsoft Dynamics NAV 2013.

  • Microsoft Dynamics NAV Team Blog

    The New Table Synchronization Paradigm in Microsoft Dynamics NAV 2013 R2

    • 34 Comments

    Microsoft Dynamics NAV 2013 R2 was dispatched with a brand new feature that introduces big challenges to all of the Microsoft Dynamics NAV channel: Multitenancy. In simple words, multitenancy allows partners to deal with hosting scenarios on-premises and in cloud services in an easier and more flexible way than in the past.

    Before Microsoft Dynamics NAV 2013 R2, partners and customers could only use a single-tenant scenario (here also called Legacy mode).

    Below a short explanation how table synchronization used to work in earlier versions.

    Microsoft Dynamics NAV 2009 / Microsoft Dynamics NAV 2013

    1. At object import/compile, C/SIDE checks the Object Metadata version in working memory and compares it to the version in Object Metadata table to decide if and what kind of change is made.
    2. Schema changes are DIRECTLY APPLIED to the SQL Server database by C/SIDE if there is no breaking schema change, otherwise an error will be thrown by C/SIDE depending on SQL Server error catch.
    3. Object Change Listener is checking for changes in metadata, then updating Microsoft Dynamics NAV Server Cache with data from Object Metadata table if the change was detected.

    A synchronization failure would typically be reported with an error like “The Object Metadata does not exist. Identification and values … “ when running the Microsoft Dynamics NAV Windows client.

    The multitenancy feature has also changed the design how Microsoft Dynamics NAV developers has to deal with object changes, overall related to table objects. Multitenancy implies that the table structure definition has to be stored in the application database and this needs to be applied on one or more separate storage databases called Tenants. From a development perspective, this means that any modification that are made to a table object in C/SIDE are NOT DIRECTLY applied to the SQL Server structure but there is a need of performing a secondary action to apply and made persistent these modification at SQL Server side: this process is called Synchronization. Microsoft Dynamics NAV 2013 R2, then, comes with a time decoupling between table metadata creation (C/SIDE) and data structure changes (SQL Server).

    In order to simplify the current design, the Microsoft Dynamics NAV development team decided to handle single- and multitenant scenarios in the same way (roughly speaking a single-tenant / Legacy mode is handled as a multitenant scenario with a single tenant database constantly mounted against an application database).

    Below a short explanation how this is working in practice.

    Microsoft Dynamics NAV 2013 R2

    SCENARIO 1:

    • Single-tenancy / Legacy mode
    • “Prevent data loss from table changes” = Yes (default):

     

    1. At object import/compile, C/SIDE checks the Object Metadata version in working memory and compares it to the version in Object Metadata table to decide if and what kind of change is made. (Same as in Microsoft Dynamics NAV 2009 and Microsoft Dynamics NAV 2013)
    2. C/SIDE then CALLS THE Microsoft Dynamics NAV Server to check for breaking schema changes in SQL Server structure.
      If C/SIDE is unable to call the Microsoft Dynamics NAV Server or if a breaking schema change is attempted (action that cannot performed due to the current SQL Server structure such as deleting a field containing data): a C/SIDE error is reported accordingly and changes to Object Metadata table will not be committed.
      If it is evaluated as not attempting a breaking schema change in SQL Server then metadata from C/SIDE working memory is saved and committed to Object Metadata table.
      PLEASE NOTE: at this stage NO CHANGES ARE MADE TO THE SQL SERVER DATA STRUCTURE.
    3. When prompting for SYNCHRONIZATION, Microsoft Dynamics NAV Server then compares Object Metadata table with Object Metadata Snapshot table content. Any difference in the value for the “Hash” field is a flag to Microsoft Dynamics NAV Server that a change exists and should be subsequently applied physically SQL Server side as structural changes.

    Prompting for Synchronization happens when

    -         Performing ANY Microsoft Dynamics NAV client action.

    For example, if a user opens a Microsoft Dynamics  NAV Windows client, then Microsoft Dynamics NAV Server is starting applying the relevant structure changes to SQL Server, and the Microsoft Dynamics NAV Windows client is not shown until all the changes are done on SQL Server side.

    OR

    -         Running the Sync-NAVTenant Windows PowerShell cmdlet.

    SCENARIO 2 (DEPRECATED):

    • Single-tenancy / Legacy mode
    • “Prevent data loss from table changes” = No (Manually opted, not persistent)

    IMPORTANT NOTICE:

    Setting the “Prevent data loss from table changes” C/SIDE switch to “No” has been intended to be used as last resource in a pure multitenancy scenario and in Test or Staging environments when partners does not have any business data database mounted against the application database. All other usages that deviate from this statement might lead to unpredictable results and even undesired data loss scenarios in upgrades or, even worse, production environments.

    Never change for any reason this parameter to “No” when developing against a single-tenant / Legacy mode database.

    1. At object import/compile: C/SIDE checks the Object Metadata version in working memory and compares it to the version in Object Metadata table to decide if and what kind of change is made. (Same as in Microsoft Dynamics NAV 2009 and Microsoft Dynamics NAV 2013)
    2. C/SIDE DOES NOT CHECK FOR ANY BREAKING SCHEMA CHANGES IN SQL SERVER but simply FORCES COMMIT of metadata from C/SIDE cache TO the Object Metadata table.
    3. When prompting for SYNCHRONIZATION, Microsoft Dynamics NAV Server then compares Object Metadata table with Object Metadata Snapshot table content. Any difference in the value for the “Hash” field is a flag to Microsoft Dynamics NAV Server that a change exists and should be subsequently applied physically SQL Server side as structural changes.

    Since no validation is made against SQL Server (“Prevent data loss from table changes” was set to “No”) there might be chances that this will result in:

    • Data Loss
      There are few specific cases where data is dropped in this scenario:
      • The primary key is detected as being no longer unique
      • Data per Company is changed from Yes to No and more than one company contains data
      • One or more fields are deleted
      • One or more field data type is/are changed
    • Missing Synchronization
      Activities cannot be completed since SQL Server prevents these actions that would break the data structure and therefore no Microsoft Dynamics NAV Windows client or Web client can connect to the database. The partner or customer has to resolve these missing synchronization issues before moving forward or fall back to a backup where these issues does no longer exists

    SCENARIO 3:

    • Multitenancy
    • “Prevent data loss from table changes” = Yes (default):

    Same as Scenario 1 for point 1. and point 2.

    When prompting for SYNCHRONIZATION, changes will be triggered and applied to the SQL Server data structure.

    Prompting for synchronization in a pure multitenant deployment happens when

    -         Performing ANY Microsoft Dynamics NAV client action

    OR

    -         Running the Sync-NAVTenant Windows PowerShell cmdlet

    OR

    -         Mounting a tenant database

     

    Based on the scenario depicted above, there might be risks of data loss and/or missing synchronization issues if handling C/SIDE development (namely dealing with Table objects) in a way that deviate by the prospected paradigm.

    Data loss issues:

    These might arise typically in one of the following scenarios:

    • Direct removal of rows from the Object Metadata table in SQL Server
    • Stretched / Borderline scenarios that implement platform files with a Build No. lower than 36281 KB 2934571 as described in this blog post.

     

    Synchronization issues:

    These might arise typically in one of the following scenarios:

    • The Microsoft Dynamics NAV Server service account has insufficient permissions
      The service account must be added to “db owner” SQL Server role for the Microsoft Dynamics NAV tenant Database.
    • Stretched / Borderline scenarios that implement platform files with a Build No. lower than 36281 KB 2934571 as described in this blog post.
      With a lower build number, you might get into one of the following scenarios:
      • When several developers commit changes at the same time in the same database / tenant while synchronization is running, this might lead to metadata corruption. (Object Metadata table now is locked for committing  changes).
      • Doing actions like FOB Import > Replace > SaveAs  and then Import again the saved FOB was causing a metadata corruption.
    • SQL Connection Timeout meanwhile performing an operation, such as when SQL Server schema changes require drop and build of indexes on large tables.
      To resolve this issue it is necessary to increment the following parameter in the Microsoft Dynamics NAV Server CustomSettings.config file
       <add key="SqlCommandTimeout" value="10:00:00" />

    Development Environment best practice

    thinking about potential data loss and synchronization issues is a brand new big challenge in the development environment, and so some consideration and following best practice might be advisable. These applies to developing solutions for both single- and multitenant deployments.

    1. Do not use Build No. lower than than 36310 KB 2934572
      As a partner, you take this as the "RTM Build No." starting point for NAV 2013 R2 and deploy this platform hotfix in the future projects while you also convert existing installations.
      NOTE: As per common best practice, we recommend that you download / request / test and deploy the latest platform hotfix for Microsoft Dynamics NAV 2013 R2. This will contain correction for minor issues not directly or just slightly related to synchronization scenarios.
    2. Never-ever change “Prevent data loss from table changes” to “No”.
      This have been noticed as one of the major source of potential data loss and missing synchronization for NAV 2013 R2 databases.
    3. Make sure that the Microsoft Dynamics NAV Server service account has been granted the “db owner” role in SQL Server.
    4. Increment the SQL Server Command Timeout parameter in the Microsoft Dynamics NAV Server configuration file that you use in development to a very high value (such as 10:00:00)
    5. For large Microsoft Dynamics NAV objects OR a high number of table modifications, do NOT use a Microsoft Dynamics NAV client action to prompt for synchronization but it is warmly preferable to use the Sync-NAVTenant Windows PowerShell cmdlet. (This is a typical scenario related to upgrades).
    6. For big batch of FOB files that are making a high number of table modifications, be sure to have this tested on a safe staging environment and import, where possible, the Table Objects in smaller chunks and synchronize them after importing every single chunk of Microsoft Dynamics NAV objects.
    7. For important changes in several table structures, such as when upgrading from previous version, it would be good to run a SQL Server Profiler trace after prompting for synchronization to check what is running on the SQL Server side and keep the synchronization monitored until it ends.

    Recommended Events:

    • SP:StmtCompleted
    • SQL:StmtCompleted

    Recommended Column Filters:

    • DatabaseName   Like <DatabaseName>
    • TextData       Not Like  SELECT %

    Bottom line. Worth mentioning that if a Microsoft Dynamics NAV Client hang / disconnect happens due to a missing synchronization issue or there were a synchronization transaction running behind the transaction rollback SQL Server side will take a higher amount of time in comparison with the same committed transaction, depending on the type of changes, resources available, etc.

    Just in case you fall back in this situation, it is warmly advisable to do not stop nor restart Microsoft Dynamics NAV Server and check through a SQL Server Profiler trace and/or via SQL Server Management Studio if the transaction has successfully rollback.

    Another blog post will follow this one, related to synchronization challenges and best practice while upgrading to Microsoft Dynamics NAV 2013 R2 from previous versions.

     

    These postings are provided "AS IS" with no warranties and confer no rights. You assume all risk for your use.

     

    Gerard Conroy - Microsoft Dynamics UK

    Abdelrahman Erlebach - Microsoft Dynamics Germany

    Duilio Tacconi - Microsoft Dynamics Italy

    Jasminka Thunes - Microsoft Dynamics Norway                   

    Microsoft Customer Service and Support (CSS) EMEA

     

    A special thanks to Jorge Alberto Torres & Jesper Falkebo from the Microsoft Dynamics NAV development team

  • Microsoft Dynamics NAV Team Blog

    Formatted decimal values dropping symbols in RDLC

    • 2 Comments

    I have seen several reports about the Microsoft Dynamics NAV RDLC reports dropping symbols out of decimals when printing out a report.  One of the most common occurrences, that I have seen, is when the de-CH locale is being used by the end user.  After some investigation, it appears that this problem is due to some changes between Windows 7 and Windows 8 (and Windows 2012). 

    Windows 7 (de-CH): 1’745.55

    Windows 8 (de-CH): 1 745.55                      [Note: the thousand separator is not printed]

    During my investigation I found some references to using “Custom Locales” to resolve this issue.  In order to use a custom locale you must build a replacement locale using the Locale Builder 2.0 tool.  There is a link to this tool at the following referenced URL.  Once this is created, you then need to replace your existing locale.  If you are interested in more information, please follow this link (http://msdn.microsoft.com/en-us/library/windows/desktop/dd317785(v=vs.85).aspx ).

    Another option ...

    There is another way that doesn’t involved changing out your locale.  All it takes is a little code and some familiarity with editing RDLC reports.  For this blog I am going to use Microsoft Visual Studio 2012 and Microsoft Dynamics NAV 2013 R2.  I have outlined the required steps below …

    1) After designing a report in the Microsoft Dynamics NAV 2013 R2 development environment, load the RDLC Layout (View\Layout).  Depending on your setup, this will either load Microsoft Visual Studio 2012 or Report Builder 3.0 (if you are using Microsoft SQL Server 2012).

    2) Once the layout is open, display the properties of the report.  This can be done by opening the Properties window (CTRL+W,P) and clicking in the blank area around the Report or right click in the blank area around the report and select Report Properties.

     
    3) You should see a Properties window like this …

    Notice the highlighted Code property – click on the value and then click on the ellipse () that appears.  This will open up the Code window.

     

    4) Scroll to the bottom of the existing code functions and add the following code …

    Public Function FormatDecimalString(ByVal Amount as Decimal, ByVal FormatString as String,ByVal Language as String) as String

      Dim CultureInfo as New System.Globalization.CultureInfo(Language)

      Return Amount.ToString(FormatString,CultureInfo)

    End Function

    The new function will convert a decimal amount to a specific cultural locale based on the format string provided in the dataset.

    5) Next, select a textbox that needs to have its printed format corrected.  Once the textbox has its border highlighted, right click and select the Expression option.  This will open the Expressions window.

     

    6) Now, copy the following code into the “Set expression for: Value” textbox.  The following code will need to replace the reference to the current value.

    =Replace(Code.FormatDecimalString(<FIELDNAME.VALUE>,<FIELDNAMEFORMAT.VALUE>,”en-US”),”,”,”’”)

    Make sure to replace <FIELDNAME.VALUE> with the appropriate value reference and replace <FIELDNAMEFORMAT.VALUE> with the appropriate format reference.  This code will replace the comma in the en-US format with an apostrophe to match the de-CH format.

    For Example:  If you use the GLBalance field from the Dataset of REPORT 4 – Detail Trial Balance, then the code would look like this …

    =Replace(Code.FormatDecimalString(Fields!GLBalance.Value,Fields!GLBalanceFormat.Value,”en-US”),”,”,”’”)

    When using the de-CH locale, the number format is similar to what en-US uses, except that the apostrophe in the de-CH format is replaced with the comma in the en-US format.

    de-CH 1’745.55 ==> en-US 1,745.55

    The basic premise behind these code changes is to convert the decimal value to a locale format that is then returned as a text.  Once in the text format, it is now possible to replace the values for the thousands and decimal separators as needed.

     Hopefully, this will make your reporting experience in Microsoft Dynamics NAV 2013 R2 a little easier.

     

    These postings are provided "AS IS" with no warranties and confer no rights. You assume all risk for your use.

  • Microsoft Dynamics NAV Team Blog

    Update Rollup 5 for Microsoft Dynamics NAV 2013 R2 has been released

    • 26 Comments

    Update rollup 5 includes all application and platform hotfixes and regulatory features that have been released for Microsoft Dynamics NAV 2013 R2.

    With update rollup 5, local hotfixes for additional countries have been added, and update rollups for Microsoft Dynamics NAV 2013 R2 now include hotfixes that apply to all countries and hotfixes specific to the following local versions:

    • AU - Australia
    • AT - Austria (NEW)
    • BE - Belgium (NEW)
    • CH - Switzerland (NEW)
    • DE - Germany
    • DK - Denmark
    • ES - Spain (NEW)
    • FI   - Finland (NEW)
    • FR - France
    • IS  - Iceland (NEW)
    • IT   - Italy
    • NA - North America
    • NL - Netherlands
    • NO - Norway (NEW)
    • NZ - New Zealand
    • SE - Sweden
    • UK - United Kingdom

     

    Where to find update rollup 5

    You can download update rollup 5 from KB 2937999 - Update Rollup 5 for Microsoft Dynamics NAV 2013 R2 (Build 36281). Note: Implementing this update rollup will require a database conversion.

    The hotfixes that have been released since update rollup 4 are listed in KB 2937999. For a full list of all hotfixes included in update rollups for Microsoft Dynamics NAV 2013 R2, see the following CustomerSource and PartnerSource pages: 

    CustomerSource:

    PartnerSource

     

    More Information

    For more information about update rollups for Microsoft Dynamics NAV 2013 R2, see Announcement of update rollups for Microsoft Dynamics NAV 2013 R2.

  • Microsoft Dynamics NAV Team Blog

    NAV Design Pattern of the Week – the Hooks Pattern

    • 7 Comments

    A new series of NAV Design Patterns is just starting. To make a good beginning, the first one is not chosen randomly. It is indeed a very powerful pattern – the “Hooks”, by Eric Wauters. It is also different from most patterns you’ve seen so far, in that it does not exist in the core product. “How can it be? A powerful NAV pattern which is not in NAV?”, you wonder.

    This is exactly the point of the Hooks. It is a partner pattern – something you, as a partner, can use, when you implement your customization. And if done correctly, it has the potential to make the next upgrade superfast.   

    Are you having a hard time installing update after update, rollup after rollup? Does it consume more resources than you had wished? Is the customization code entangled with the core product code, in such a way that each update requires complicated merges, with the developer trying to figure out which code goes where?

    To keep it short, here it is – the Hooks pattern. Most powerful when starting a new customization, as it can be implemented fully. It will keep things simple. As for the legacy customizations... it is still possible to use it, by refactoring key areas such as areas with the most update merge issues.

    Hooks Pattern

    by Eric Wauters (waldo), Partner-Ready-Software

    Meet the Pattern

    By minimizing the code in already existing application objects, you will make the upgrade process much easier, and all customization business logic will be grouped in new objects.  When using atomic coding, it will be very readable what is being customized on a certain place in an existing part of the application.

    To minimize the impact of customizations, the idea of hooks is:

    • First of all, name the places in the already existing code where customization is needed;
    • Second, place your business logic completely outside the already existing application code.

    Know the Pattern

    When doing development over years, by different developers with different mindsets, the standard codebase gets changed a lot, adding multiple lines of code, adding local and global variants, adding or changing keys, changing existing  business logic, … .  In other terms, the standard text objects are being changed all over the place.. .

    After years, it's not clear why a change was done, and what was the place where the change was intended to be done.  And the latter is quite important in an upgrade process, when code in the base product is being refactored: if the exact place of the posting of the Customer Entry is being redesigned to a separate number, the first thing I need to know, is that I did a certain change at the place: "where the posting of the Customer Entry starts".  The definition of that place, we call a "Hook".

    I recommend to use this concept on the following:

    • All objects of the default applications that need to be changed
    • On objects that should not hold any business logic (like tables, pages, XMLPorts)

    Use the Pattern

    Step 1 - if it doesn't exist yet - you create your Hook codeunit.  As the name assumes .. this is always a codeunit.  We apply the following rules to it:

    • One Hook always hooks into one object.  Which basically means that I will only declare this new codeunit in one other object (which is its parent object)
    • The naming convention is: The_Original_Object_Name Hook.  Naming conventions are important, just to find your mapped object, and also to be able to group the Hooks.

    Step 2, you  create the hook, which is basically a method (function) in your codeunit.  The naming is important:

    • The naming of the hook should NOT describe what it is going to do (So, examples like CheckMandatoryFields, FillCustomFields should not be used as a hook)
    • The naming of the hook should describe WHERE the hook is placed, not what the hook will be doing (as nobody is able to look into the future .. :-))
    • To help with the naming, it is a good convention to use the "On"-prefix for these triggers.  This way, it's very clear what are hooks, and what aren't..

    Step 3, it's time to hook it to its corresponding object and right place in the business logic of that object.  You do this by declaring your codeunit as a global in your object, and using the created hook function on its place in the business logic.  This way, these one-liners apply:

    • A Hook codeunit is only used once in one object only (its corresponding object)
    • A Hook (function) is used only once in that object.  As a consequence, changing the parameters has no consequence: you only need to change one function-call
    • The codeunit is declared as a global.  That exact global is the only custom declaration in the existing object .. Everything else is pushed to the hook-codeunit.

    Step 4, implement your business logic in the hook.  Do this in the most atomic way, as there is a good chance that this same hook is going to be used for other business logic as well.  Best is to use a one-line-function-call to business logic, so that the Hook Function itself stays readable.

    Example

    Suppose, we want to add business logic just before posting a sales document.  In that case, we have to look for the most relevant place, which is somewhere in the "Sales-Post" codeunit.  So:

    Step 1: create codeunit Sales-Post Hook:

    Step 2: create the hook function OnBeforePostDocument:

    Step 3: declare a global in the Sales-Post codeunit, called SalesPostHook.  Then,...

    Continue reading on the NAV Patterns Wiki...

     

    Best regards,

    The NAV Patterns team

Page 2 of 43 (637 items) 12345»