Dateformula

rokoroko Member Posts: 16
edited 2008-01-24 in Dynamics AX
Hello.
I want to ask is there any data type in Axapta, which is equivalent to Dateformula data type in Navision?

Comments

  • icelanderwillicelanderwill Member Posts: 5
    I am not familiar with NAV, but I can give you some hints in AX.

    The basic Extended Data Type is date. If you mean functionality for date modification, there are standard date modification commands which could shift your date. Here is an example job:
    static void DateFormatTest(Args _args)
    {
        date    _date = systemdateget();
        ;
        
        info("Builtin date functions");
        info(strFmt("Current date: %1", _date));
        info(strFmt("Current year: %1", year(_date)));
        info(strFmt("Current week: %1", wkofyr(_date)));
        info(strFmt("Next month: %1", nextMth(_date)));
        info(strFmt("Prev month: %1", prevMth(_date)));
        info(strFmt("Next quarter: %1", nextQtr(_date)));
        info(strFmt("Prev quarter: %1", prevQtr(_date)));
        info(strFmt("Next year: %1", nextYr(_date)));
        info(strFmt("Prev year: %1", prevYr(_date)));
        info(strFmt("End of month: %1", endMth(_date)));
        info(strFmt("Custom date: %1", date2str(_date, 213, 1, 1, 4, 1, 4)));
        info(strFmt("Built date: %1", mkDate(19, 11, 1999)));
    }
    

    When you just pass a date into a string formatting function, you receive the date formatted according to your regional settings in Windows.

    Also you should look into \\AOT\Classes\Global class, and check everything starting with "date".
  • rokoroko Member Posts: 16
    This is not exactly what I have asked for, but thanks.
    I will now try to explain my problem in details: We have a table where we keep information about employees in our company. One of the fields is "Hiring date". We need a new field, where we can enter so called "Attestation period". For example "6M", which means that the employee has to be attestated in 6 months since the hiring date. This type of field is called dateformula in Navision. It can have values like "1M-2D+2W" which stands for one month, minus 2 days, plus 2 weeks. It is used to calculate dates, based on other days. I hope you got what I type of field I want. So is there such type, or type which is similar to what I want and with some modification can be used as Navision dateformula type.
Sign In or Register to comment.