Advertisements

Future of Navision is extensions V2?

With the release of Dynamics 365 Business Central a successor of Dynamics NAV, things are going to change. If I am not wrong from year 2020 Modern Development Environment will be the only platform available to developers.

In every NAV upgrades biggest challenge was customizations, since objects are fully accessible to developers, so we customize the solution as we want as a developer spreading unstructured, difficult to maintain, customized code everywhere and in all objects.

The beauty of product is, it is totally customizable and adaptable to customer’s business. Customizing Navision is easy and quick to deploy. C/AL is easy to learn and code.

Due to these heavy customizations and unstructured codes upgrade to new version of the product required long time and efforts. Hard to merge, too much efforts leading to high cost, usually many customer prefer to stay with their current version, and miss new capabilities of product available in future versions of Navision.

With release of NAV 2016 concept of extension was introduced. This introduced the concept of writing code isolated from the core objects and use events to interact with the standard codes. Now create the extension that can be installed or uninstalled any time without affecting the original base layer of the product. We call it extension V1.

These were also developed using C/AL and deployed using PowerShell. But still it always felt like something is missing. Then last year Microsoft came up with release NAV 2018 which introduced second generation of extension, we call it extensions V2.

This introduced completely new development platform based on Visual Studio Code Modern Development Environment. It uses new AL language an evolution of C/AL. Now this will be the future.

Dynamics 365 Business Central platform (on-premise and SaaS) uses this development model. Probably this will be the only development platform available from year 2020.

In Business central base application is now an entire extension based with some system objects in CSIDE, In future release you may not have any more side by side development, you will only be having AL and extensions.

 

So what next?

 

  • We should now concentrate on learning VS Code and AL as in future this will be the only way to modify the application.
  • Now we need to make our self-familiar with the Web Client as Windows Client will be obsolete soon.
  • We should start moving our all customization to extensions.
  • Now we should start thinking in direction of AL type customization rather than old C/AL type coding practice.

 

What do you think?

I will come up with more details as progress in this direction. Till then keep learning and sharing with others.

 

 

 

Advertisements

Events in C/AL Navision 2016

By implementing events in C/AL code, you can design applications to react to specific actions or behaviour that occur.

Events enable you to separate customized functionality from the application business logic.

By using events in the application where customizations are typically made, you can lower the cost of code modifications and upgrades to the original application.

Events can be used for different purposes, such as generating notifications when certain behaviour occurs or the state of an entity changes, distributing information, and integrating with external systems and applications.

How Events Work

There are three major participants involved in events: the event, a publisher and a subscriber.

An event is the declaration of the occurrence or change in the application. An event is declared by a C/AL function, which is referred to as an event publisher function. An event publisher function is comprised of a signature only and does not execute any code.

A publisher is the object that contains event publisher function that declares the event. The publisher exposes an event in the application to subscribers, essentially providing them with a hook-up point in the application. An event is raised by adding logic to the application that calls into the publisher to invoke the event (the event publisher function). There are three different event types: business, integration, and trigger events.

Business and integration type events must be explicitly declared and published, which means that you must create event publisher functions and add them to objects manually. On the other hand, trigger events, which occur on table and page operations, are published and raised implicitly by the Microsoft Dynamics NAV runtime. Therefore, no coding is required to publish them.

A subscriber listens for and handles a published event. A subscriber is a C/AL function that subscribes to a specific event publisher function and includes the logic for handling the event. When an event is raised, the subscriber function is a called and it code is run.

How to Implement Events

Implementing events in Microsoft Dynamics NAV consists of the following tasks:

  1. Publish the event. For business and integration events, create and configure a function in an application object to be an event publisher function.
  2. Raise the event. Add code that calls the event publisher function..
  3. Subscribe to the event. At the consumer end, add one or more subscriber functions that subscribe to published events when they are raised.

Will come up with how to practically use it in my upcoming posts.

Redesigned C/AL Editor in Navision 2016

The C/AL Editor in the Microsoft Dynamics NAV Development Environment has been redesigned to give you more coding capabilities. Coding in the new C/AL editor is like before except you benefit from new features such as IntelliSense, name completion, change tracking, improved syntax highlighting and colorization. The new design has a look-and-feel that resembles the Debugger regarding breakpoints.

Name Completion:  Editor-1

Now Editor suggest the Variable Names which are available.

IntelliSense:  Editor-2
Now Editor Suggest available options for the variables.
Editor-3

Change Tracking:  Editor-4

Improved syntax highlighting and colorization:
Editor-5
If you still want to use old version editor, you can use the old version of the C/AL Editor by running the Microsoft Dynamics NAV Development Environment from a command prompt and setting the useoldeditor parameter.
Editor-6

finsql.exe useoldeditor=yes

useoldeditor Specifies whether to use the C/AL Editor that was available in Microsoft Dynamics NAV 2015 and earlier versions. The C/AL Editor was redesigned in Microsoft Dynamics NAV 2016.

To use the old editor, specify the parameter as useoldeditor=yes or useoldeditor.

To use the new editor, omit the parameter or specify it as useoldeditor=no.

Changes in C/AL Behaviour C/AL Statements in Nav 2016

The following table lists the summary of new, removed, or changed C/AL statements in Microsoft Dynamics NAV 2016.

Will come with more details in my later posts.

Statement Description
FOREACH New statement.

Iterate through a .NET Framework collection or array.

BREAK New statement.

Terminates the iteration statement in which it used.

Important

If your solution has used FOREACH or BREAK as names of variables in earlier versions of Microsoft Dynamics NAV, you must change the names before you upgrade to Microsoft Dynamics NAV 2016.

Alternatively, you can enclose the variable names in quotation marks. If you do not, and you import an object that has this code in text format, you cannot compile the object.

Changes in C/AL Behaviour C/AL Properties in Nav 2016

The following table lists the summary of new, removed, or changed properties in Microsoft Dynamics NAV 2016.

Will come with more details in my later posts.

Function Description
Event Property New property.

Used for events. Specifies whether a function is a publisher of or subscriber to an event.

EventFunction Property New property.

Used for events. Specifies the event publisher function that an event subscriber function subscribes to.

EventPublisherObject Property New property.

Used for events. Specifies the object that contains the event publisher function that an event subscriber function subscribes to.

EventSubscriberInstance Property New property.

Specifies how event subscriber functions in a codeunit are bound to codeunit instance and events that they subscribe to.

EventType Property New property.

Used for events. Specifies whether an event is a business or integration event.

GlobalVarAccess Property New property.

Used for events. Specifies whether global variables in an event publisher object can be accessed from event subscriber functions.

IncludeSender Property New property.

Used for events. Specifies whether global functions in an event publisher object can be called from event subscriber functions.

Namespaces Property New property.

Specifies one or more namespaces on an XMLport object.

NamespacePrefix Property New property.

Specifies a namespace prefix on an element of an XMLport object.

OnMissingLicense Property New property.

Specifies what happens to the event subscriber function call when the license of the Microsoft Dynamics NAV user account that is running the current session does not include the codeunit that contains the subscriber function.

OnMissingPermission Property New property.

Specifies what happens to the subscriber function call when the Microsoft Dynamics NAV user account that is running the current session does not have permission to the codeunit that contains the subscriber function.

EventPublisherElement Property New property.

Used for events. Specifies the table field that the trigger event pertains to.

Scope Property New property.

Specifies the scope of actions to be either Repeater or Page.

SQL Timestamp Property New property.

Specifies a field to be a timestamp field that contains row version numbers for records.

TableType Property Specifies whether the table is a normal or external (CRM or ExternalSQL) table.
TryFunction Property New property.

Specifies the function to be try function, which can be used to catch and handle errors and exceptions that occur when code is run.

FunctionType Property (Upgrade Codeunits) Changed property.

Instead of the Upgrade option, there are now two options: UpgradePerCustomer and UpgradePerDatabase. The UpgradePerCustomer option behaves like the Upgrade option in the previous Microsoft Dynamics NAV version.

FunctionType Property (Test Codeunits) Changed property.

Includes the FilterPageHandler and HyperlinkHandler options.

Changes in C/AL Behaviour C/AL Functions in Nav 2016

The following table lists the summary of new, removed, or changed functions in Microsoft Dynamics NAV 2016.

Will come with more details in my later posts.

Function Description
ADDFIELD Function New function.

Adds a table field to the filter control for a table on filter page.

ADDFIELDNO Function New function.

Adds a table field to the filter control for a table as specified by the field number.

ADDRECORD Function New function.

Adds a filter control for a table to a filter page as specified by a record data type variable.

ADDRECORDREF Function New function.

Adds filter control for a table to a filter page as specified by a RecordRef variable.

ADDTABLE Function New function.

Adds filter control for a table to a filter page.

BINDSUBSCRIPTION Function New function.

Binds event subscribers to the subscriber codeunit instance for handling events.

UNBINDSUBSCRIPTION New function.

Unbinds event subscribers from the subscriber codeunit instance for handling events.

COUNT Function (FilterPageBuilder) New function.

Gets the number of filter controls that are specified in the FilterPageBuilder object instance.

CREATEENCRYPTIONKEY Changed function.

Includes a Boolean return value. The value is true if an encryption key is created successfully; otherwise, it is false.

CURRENTCLIENTTYPE Function New function.

Gets the Microsoft Dynamics NAV client type that is running on the current session.

CURRENTCOMPANY Function (Record) New function.

Gets the current company of a database table record.

CURRENTCOMPANY Function (RecordRef) New function.

Gets the current company of a database table that is referred to by a RecordRef.

DEFAULTCLIENTTYPE Function New function.

Gets the default Microsoft Dynamics NAV client type that is configured for the Microsoft Dynamics NAV Server instance that is used for the current session.

GETASCENDING Function (Record) Gets the sort order for the records returned, such as in data from an ODATA web service.
GETURL Function Changed function. Includes the following changes:

  • Accepts CURRENTCLIENTTYPE and DEFAULTCLIENTTYPE as ClientType parameter.
  • Supports RecordRef variable data type as a parameter to specify the record to open.
  • Includes a Boolean parameter to include filters that are setup on the object in URL.
GETVIEW function (FilterPageBuilder) New function.

Gets the filter view (which defines the sort order, key, and filters) for the record in the specified filter control of a filter page.

IMPORTENCRYPTIONKEY Changed function.

Includes a Boolean return value. The value is true if an encryption key is imported successfully; otherwise, it is false.

ISFILTERPAGEBUILDER Function (Variant) New function.

Indicates whether a C/AL variant contains a FilterPageBuilder variable.

ISTEMPORARY Function (Record) New function.

Determines whether a record refers to a temporary table.

NAME Function (FilterPageBuilder) New function.

Gets the name of a table filter control that is included on a filter page based on an index number that is assigned to the filter control.

RECORDID (Record) New function.

Gets the RecordID of the record that is currently selected in the table.

RUNMODAL Function (FilterPageBuilder) New function.

Builds and runs the filter page.

SETASCENDING Function (Record) Sets the sort order for the records returned, such as in data from a ODATA web service.
SETVIEW Function New function.

Sets the current filter view, which defines the sort order, key, and filters, for a record in a filter control on a filter page.

GETDEFAULTTABLECONNECTION Function (Database), HASTABLECONNECTION Function (Database), REGISTERTABLECONNECTION Function (Database), SETDEFAULTTABLECONNECTION Function (Database), and UNREGISTERTABLECONNECTION Function (Database) New functions. Registers, sets, gets, and unregister table connections to external tables.

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: