How to connect a Native Android Application to Dynamics 365 FO

Dynamics 365 for Finance and Operations is built on open standards like OAuth 2.0, OData v4 and RESTful JSON Web service APIs, which makes it possible for us to integrate our business apps with many different platforms and environments. One of these possibilities is integration with the popular mobile development platform of Android.

Microsoft already has open source libraries and tools to integrate Android with Azure hosted services and in this example, we will see how to integrate Android mobile platform with Dynamics 254 for Finance and Operations.

Continue reading “How to connect a Native Android Application to Dynamics 365 FO”

D365 FO: How to track data changes with AIF change tracking

You may need to track changes in a table or data entity for your own data staging or logging purposes. AIF framework has a change tracking feature which uses SQL server stored procedures to track data changes in AX tables, which is also the standard change tracking used by the DMF (DIXF) framework to handle incremental push of data. Implementation is as easy as below. Create a data entity (or a Query) for your source AX table and initialize DB tracking on your data entity using the code below (As of writing, in D365 FO Spring 2018 release) :

class AIFChangeTrackingInit
{
    public static void main(Args _args)
    {
        AifChangeTrackingScope scope = 'ANDVisitScheduleTrackingScope';
        DictDataEntity dictEntity   = new DictDataEntity(tableNum(ANDVisitScheduleEntity));
        boolean		isSuccess = false;
        AIFSQLCDCENABLEDTABLES  ctEnabledTables;

        new AifChangeTrackingPermission().assert();
        aifchangetrackingconfiguration::initialize();
        isSuccess = AifChangeTrackingConfiguration::enableChangeTrackingForDataEntity(scope,dictEntity,true, AifChangeTrackingType::SqlChangeTracking);
        info(strFmt("Is success : %1", isSuccess));
    }
}

Continue reading “D365 FO: How to track data changes with AIF change tracking”

Extension instance variables within static Dynamics 365 FO form event handlers

To extend a form in D365 for Operations, we can use pre-defined events and form delegates. Event handler methods on a handler class can be assigned to them to be called when the event is triggered (For more info, see my previous post AX7 Extensibility – Part 3 : Event handlers and delegates (hooks)). As you know static methods can be called without creating a class instance and cannot access its class instance variables.

What if we need to access a class instance variable within these static event handlers?Like for example, the ‘counter’ variable below within the handler class?

final class TSExtensionInstanceTestHandler
{
    private int counter;

    [FormControlEventHandler(formControlStr(TSExtensionInstanceTest, Counter), FormControlEventType::Clicked)]
    public static void Toggle_OnClicked(FormControl sender, FormControlEventArgs e)
    {
        FormRun formRun = sender.formRun();
    }
    [FormControlEventHandler(formControlStr(TSExtensionInstanceTest, Test), FormControlEventType::Clicked)]
    public static void Test_OnClicked(FormControl sender, FormControlEventArgs e)
    {
        FormRun formRun = sender.formRun();
    }
}

Continue reading “Extension instance variables within static Dynamics 365 FO form event handlers”

WebAssembly, a new era of web platform programming

Today Javascript is the most accepted client side programming standard for the web platform. Originally designed as a simple scripting language to write small logic into HTML pages (as “script” in it’s name implies), today it is immensely used in modern web projects, together with massive sized open source Javascript libraries like Angular, React, Backbone, Ember. The demand for browser based applications is getting higher everyday since creating a browser based application is undoubtedly the best option if you want to create a multi platform and multi device application. Therefore many enterprise applications today, like ERP and productivity applications target world wide web as their development platform.

Although it is pretty “the standard” technology for today’s web client programming, is Javascript alone able to handle those future requirements of heavy, functionality rich enterprise applications?

In this article we will have a quick look at one of newest technologies in browser based application programming, the new “WebAssembly” technology, and explain its potential impact for the future.

Continue reading “WebAssembly, a new era of web platform programming”

Simple server-side scripting with ASP.NET Razor

With the introduction of .NET framework and ASP.NET in the late 1990s, the legacy HTML embedded single page web application model of ASP is replaced by the Web Forms (and later ASP.NET MVC model). While the new ASP.NET models brought many new possibilities and made it easier to create enterprise web applications, the simplicity of legacy ASP was left behind.

Continue reading “Simple server-side scripting with ASP.NET Razor”

Using .NET attributes for D365 FO child class constructors

Previously, we used to define class constructors like below if we want to switch correct child class via a parameter :


public static AtTest constructFromCommon(Common _common)
 {
 AtTest ret;

switch(_common.Tableid)
 {
 case tableNum(CustTable) :
 ret = new AtTest_Customer(_common);
 break;
 case tableNum(VendTable) :
 ret = new AtTest_Vendor(_common);
 break;
 }

return ret;

}

Since AX 2012, we have the ability to create and use .NET attributes and in D365 FO they are widely used in the extension framework.

Continue reading “Using .NET attributes for D365 FO child class constructors”

Generating deep links for D365 FO forms and records

Dynamics 365 FO has an API to create URL links that point to certain forms and records, in other words “Deep links”. This way you can share a record or query within AX with others for example within an e-mail, or inside an extensible control you have written.

Below I give an example method, used in a runnable job, which generates a deep link for a record on a form, using a single field as a query parameter. To be able to test it, cop and paste the code into a runnable class and run it in USMF company of D365 one-box development environment:

Continue reading “Generating deep links for D365 FO forms and records”

AX7 (D365) Chain of command with examples

As of platform update 9 of Dynamics AX for Operations, we have a new extension possibility called chain of command. Now we are able to add pre and post functionality to extensible methods in a much easier and readable manner than the previously used event handlers, also we are now able to access protected methods and variables directly in the extended class without problems.

Now let’s check how it works with an example. Create two classes, one is the base class of the other and add a method we want to extend called ‘testMe’. Add infolog calls inside the method to track the execution :

Continue reading “AX7 (D365) Chain of command with examples”