DAXSPOT

Monday, May 20, 2019

Display number of years in a lookup

Hi,

Today i got a requirement to show number of years in lookup.
This post will help you to show specific number of years in a look up.


public void lookup()
{
    Counter yearCount;
    List    valueList = new List(Types::String);

    for (yearCount = 0; yearCount < 5; yearCount++) //here 5 is number of years to show
    {
        valueList.addEnd(strFmt("Year %1", year(SystemDateGet()) - yearCount)); //getting system date year and minus with the count and add in list
    }

    SysLookup::lookupList(this, valueList, "List of years");
}


Happy Daxing! 😃

No comments:

Post a Comment

How to execute SQL directly form Dynamics AX X++

How to execute Sql directly form Dynamics AX X++ Reference by : alirazazaidi Dynamics Ax provide many other ways to communicate with databas...