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

  • ~ Mohamad Adel, Sr. Dynamics AX Developer at Al-Fanar IT

    Adel"I recommend Amer Atiyah as i worked with him in many simple and complicated tasks and i realized that he is very intelligent in the way of thinking to solve tasks problems. He has a very good experience and knowledge of his job. He is very hard worker, committed, organized and creative and very open mind in his work and that is the reason if his brilliant in his specialized field. He is always showing a high degree of professionalism and ability to deliver and accomplish very complicated tasks at any condition with high quality. I am recommending him to work in any team and i know he will fit with all challenges. Purely, he is a professional guy. I wish to him more and more success in his career and his life."

  • Read more testimonials »