Thursday, July 28, 2011

Hijiri calender in Dynamics AX

Dear All,
this post i got from my senior colleague 
i want to share this with you..if you have any query send to me....



I’ve identified the way to show Hijiri Calender in Dynamics Ax, Generally in Dynamics AX we can’t show Hijiri Calender to user  to select a Hijiri date (when we are not in the Arabic  language/culture mode), Till now  we ask user to just enter the date in the text box then check  the given  date is valid Hijiri date or not by using DotNet DLL. By this way we can show the Hijiri (Arabic) calendar to the user to select the Hijiri (Arabic) Date. All of us can use it in Development  to add the Hijiri Date where ever required. For Chennai office import the attached XPO in to Development Environment.






Steps Taken  to Achieve:
I did a small research to show Hijiri Calender, had a look in the sysdate EDT which is showing Calendar to select a particular date, this EDT is referring to SysDateLookUp Form, then I duplicated the form and made changes as Folllows.
1.Duplicate the SysDateLookUp Form and Name it as HijiriDateLookup.
2. In the Init method set the calendar type to Hijiri Calender (default is from user settings) this will show you the Hijiri Calender. But it will return the Gregorian(English) Date only
3. in CloseSelect method just convert the return date to Hijiri Date, to do this I Added a new method to convert that Gregorian(English) Date to  Hijiri  Date using Native AX Dotnet Namespaces.
4. Created New String  EDT HijriDate  and set lookup ref to this new form, and set some properties to look like default Datetime picker (look at the EDT)
5. refer this EDT in the Table fields or the controls in the form for Hijiri Date.

here you can find one attachment (.XPO) on AX.

6 comments:

  1. I am using that calendar on EP but it could not work kindly provide help

    ReplyDelete
  2. hi aijaz.. it created for normal AX forms...i will re design this callender for your EP forms

    ReplyDelete
  3. Hi,

    Is that hijri format replicate in SSRS reports?

    Need to know whether it can be done or not?


    Regards,
    Zahir

    ReplyDelete
  4. can you send me the new method to convert that Gregorian(English) Date to Hijiri Date using Native AX Dotnet Namespaces.

    ReplyDelete
  5. Well..using this method....if hijri date year comes out to be less than 1900 which mostly will, then AX doesn't accept it for a date as datenull() = 01/01/1900.

    ReplyDelete
  6. Hi Asaraf,

    How can we do this in D365?

    ReplyDelete