Monday, 20 April 2015

Date functions in ax 2012

Date functions in ax 2012


/ TransDate  d;
    
     OR

      date d;
    ;
     d=today();
      
    info(strFmt("date - %1",d));
    //Gets the month for the given date...
    info(strFmt("month  %1",mthOfYr(d)));
    
    //Gets the month name form the give data....
    info(strFmt("month Name %1",mthName(mthOfYr(d))));
   // Gets the day for the give  date...       
    info(strFmt("day %1",dayOfMth(d)));
     //Gets the day name from the given date...
     info(strFmt("Day Name %1",dayName(dayOfMth(d))));
    // //Gets the year for the given date...
    info(strFmt("year -%1",Year(d)));
    //gets the Current weekend number from the Date....
    info(strFmt("weekday number - %1",dayOfWk(d)));
    //gets the  day of  the  year  form  the give date...
    info(strFmt("Day  of year - %1",dayOfYr(d)));
    // gets the  week of the  year  form the give data...
    info(strFmt("Week of  the year - %1 ",wkOfYr(d)));

Wednesday, 8 April 2015

Filter record through code

Filter record through code

1 Create table,

2  Create form  add to data Source

public void executeQuery()
{

    QueryBuildRange Qbr;
    ;
    // str name;
   
   
   


     Qbr = this.query().dataSourceTable(tableNum(TeskTable)).addRange(fieldNum(TeskTable,Name));

    Qbr.value(queryValue(name.text()));
 
   super();
}



  3  add to    TextBox   Call  Execute Query   modified Method

StringEitd   wrtie  code

public boolean modified()
{
    boolean ret;

    ret = super();
   
    TeskTable_ds.executeQuery();
   
    return ret;
}