Browsing all articles tagged with .NET Archives - Amer Atiyah, Microsoft Dynamics 365 Blog
5

In a previous post, I descriped in deatils how to gte (and set) Hijri date in Microsoft Dynamics AX 2009. In that post I have shown how to get Hirji date in Dynamics AX by calling a SQL function from X++.

A calleague of mine has also came up with another great idea to handle the Hirji date using the CLR Interoperability. The standard Dynamics AX 2009 comes with a set of very important .NET libraries referenced to be used automatically in Dynamics AX 2009.

 

References in AOT

 What you could use out of those libraries: System.Globalization library of .NET framework. But of course, you have to use a string to show the value of that date since you cannot get a Hirji date (with its values like 1430 as a year) and assign it to an X++ date datatype.

Check out this code to have the Hirji date converted from X++ gregorian date:

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
 display STRExtendedDT ExpieryDate_H()
{
    System.Globalization.Calendar           Calendar = new System.Globalization.HijriCalendar();
    System.Globalization.DateTimeFormatInfo hirjiDate;
    System.Globalization.CultureInfo        cultureInfo = new System.Globalization.CultureInfo("ar-SA",false);
    System.DateTime                         dt;
    STRExtendedDT                           dateString;
    ;
 
    dt = this.ExpieryDate;
    hirjiDate = cultureinfo.get_DateTimeFormat();
    hirjiDate.set_Calendar(Calendar);
    dateString = dt.ToString("dd/MM/yyyy", hirjiDate);
 
    return dateString;
}

You will get :) :

Hirji date

1

Microsoft has added a very useful functionality in the new release of Microsoft Dynamics AX 2009 that is: Workflow. I have explored many articles by Microsoft and others about Workflow in Microsoft Dynamics AX 2009. For the technical articles part, all of them are describing the workflow in a technical format that prevents the reader from seeing the whole picture of this functionality that has been delayed a lot. This is so important to be known.

Microsoft did not implement the workflow inside Microsoft Dynamics AX itself, they preferred to use WWF (Windows Workflow Foundation) that has been released with the .NET Framework 3.5.  WWF is a new feature that builds and executes workflows inside .NET applications. WWF workflow engine, the one that runs the workflow inside Microsoft Dynamics AX 2009, is published and configured in the IIS.  The following diagram shows you how this happens:

Workflow engine in Microsoft Dynamics AX 2009

Workflow engine in Microsoft Dynamics AX 2009

By this, Microsoft has gained the advantage of the new functionalities that would be added later on WWF without upgrading Microsoft Dynamics AX itself (for most of the cases at least).  And this is a great example of what you can do when using .NET business connector of Microsoft Dynamics AX.

In the following picture, you could see that workflow runtime, currently, is residing inside IIS.

Microsoft Dynamics AX Workflow Runtime

Microsoft Dynamics AX Workflow Runtime

Someone might ask: why did’nt Microsoft lunched the workflow runtime on the AOS of Dynamics AX.  Actually Microsoft is planning to do so in the soonest (this might be in Microsoft Dynamics AX 2010). But they have made it on IIS because the AOS is written in a native code, not in a managed code.  And since WWF is part of “very managed” .NET environment, it’s time and effort consuming for them to make such integration. So they simply put the workflow runtime on the IIS till they completely convert the AOT into managed code.

You guys could benefit from a video that has been recorded in PDC 2008. Josh Honeyman, a Senior Development Lead at Microsoft, shows how workflow is implemented in Microsoft Dynamics AX 2009 and its future. To watch the video, press here.

Dynamics AX 2012 Event

Recent Posts

Tags

Archives

Random Testimonial

  • ~ Muheet Shariff, Dynamics AX Consultant

    muheet"I have found Amer a pleasant, generous person who is never afraid to take on a challenging task.Amer is an independent, self directed person who is able to communicate effectively and meet even the most demanding challenges. I am positive he will make outstanding contributions to Microsoft technologies. It was a great experience working with Amer during our implementation of Dynamics AX at  Al-Fahad and Al-Othaim companies. His support to Microsoft Dynamics AX is outstanding and very professional. Technically he sounds very strong. It was a great pleasure to be associated along with Amer performing some challenging tasks. I wish him to reach the desired success with his professionalism."

  • Read more testimonials »