Microsoft Dynamics AX Thoughts
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.
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
:
4 Comments to “Yet another great way to handle the Hijri date in Dynamics AX!”
Post comment
Search the site
Dynamics AX 2012 Event
Recent Posts
- Enterprise Portal is Not Working on Dynamics AX 2012 Hyper-V Image
- Dynamics Academy – An Academic Project for Microsoft Dynamics in Saudi Arabia
- Microsoft Dynamics AX 2012 Event in Khubar
- Knowledge Bridge
- Columbus IT
- Fawzi Al-Nahdi and Partners Holding Group
- Dynamics AX 2009 Shows One Line Only in Its Grids
- Talal Abu-Ghazaleh
Tags
Archives
- December 2011 (2)
- November 2011 (3)
- July 2011 (2)
- June 2011 (4)
- May 2011 (3)
- April 2011 (4)
- March 2011 (12)
- February 2011 (2)
- January 2011 (3)
- December 2010 (1)
- November 2010 (1)
- October 2010 (5)
- August 2010 (1)
- July 2010 (3)
- June 2010 (4)
- May 2010 (5)
- April 2010 (1)
- March 2010 (9)
- February 2010 (4)
- January 2010 (4)
- December 2009 (11)
- September 2009 (1)
- August 2009 (1)
- July 2009 (2)
- September 2008 (1)
Random Testimonial
- ~ Muzammil Ahmad, ERP Manager at Abdul Aziz Alsorayai Investment Group
"Thing that I have seen in Amer in a broader view, that, he is a type of guy who takes the tasks in a professional way,concentrate on tasks, work on them with a cool & calm mind but fullfil the tasks in time. Having a humble nature, its normally a pleasure for everyone to work with Amer" - Read more testimonials »
What's the little bird saying?
- Get a weekly doze of technology with the Microsoft Mondays Webcasts http://t.co/wyQSlYH3. This month showcases SSDT, Azure and SharePoint. 2 weeks ago
- @fawad343 Why not :)... I spent my honeymoon there.. and I would love to get back to it again! :D 3 weeks ago
- @saadalahmed تعليق بسيط... لاشيئ في العالم يسمى اسرائيل... لعلك تعني المغتصبة فلسطين؟ 3 weeks ago
- More updates...
Posting tweet...
Powered by Twitter Tools

May 15, 2010 in 

May 16, 2010 at 1:42 am
Very good post man, it’s very strong capability in AX 2009 to make use of .NET CLR
)))
May 16, 2010 at 5:41 pm
Thanks to you Amr! you’re the one who created it
It is really a great feature that enables you to “fish in the .NET sea” by an X++ hook!
October 5, 2010 at 11:49 am
[...] Yet another great way to handle the Hijri date in Dynamics AX! [...]
October 5, 2010 at 1:01 pm
[...] Yet another great way to handle the Hijri date in Dynamics AX! [...]