Alfasith AX

Alfasith AX
اللَّهُمَّ انْفَعْنِي بِمَا عَلَّمْتَنِي، وَعَلِّمْنِي مَا يَنْفَعُنِي، وَزِدْنِي عِلْمًا

Tuesday, September 30, 2014

Worker and his financial dimension relation in AX


Hi,

static void ListOutAllWorkerWithDim(Args _args)
{
    Counter                                               i;
    HcmWorker                           hcmWorker;
    HcmEmployment                       hcmEmployment;
    while select hcmWorker   //=   HcmWorker::findByPersonnelNumber('000173');
    {
     hcmEmployment = hcmEmployment::find(hcmWorker.recid);//.DefaultDimension != 0
    if(hcmEmployment.DefaultDimension)
        info (int642str(hcmEmployment.DefaultDimension) +'--'+  hcmWorker.PersonnelNumber);
    }
    //hcmEmployment   =   HcmEmployment::find(hcmWorker.recid);
}

Regards,

Wednesday, September 10, 2014

To get Calender, Date, Day or month in AX


Hi,

static void AlfasithCalender(Args _args)
{
    print dayOfMth(today());        // Date
    print dayOfYr(today());         // Day of year
    print wkOfYr(today());          // Week of  year 
    print mthOfYr(today());         // month in numerals;
    print mthName(mthOfYr(today())); // Month Name
    print year(today());            // Year
    print dayName(dayOfWk(today()));// Day like Monday, tues...
   // print mkdate(1,mthofyr(today()),year(today())); // Date with separator as "/"
    print today();
    print date2str(today(),123,2,2,2,2,4); // Date with sepearator as "."
    pause;

}

Regards,

How find size of recordsortedlist in D365/AX 2012

Hi, This is the continuity of the previous article where we are now getting the size of recordsortedlist . if(recordsortedlist.len() >1) ...