Home

Friday, December 19, 2014

Get EmployeeDetails Ax 2012

static void EmployeeDetails(Args _args)
{
    HcmWorker                     hcmWorker;
    DirPartyTable                 dirPartyTable;
    DirPartyLocation              dirPartyLocation;
    LogisticsPostalAddress        logisticsPostalAddress;
    LogisticsLocation             logisticsLocation;
    HcmPersonPrivateDetails       hcmPersonPrivateDetails;
    HcmEmployment                 hcmEmployment;
    LogisticsElectronicAddress    logisticsElectronicAddress;
    HcmWorkerTitle                hcmWorkerTitle;
    HcmTitle                      hcmTitle;
    HcmPositionWorkerAssignment   hcmPositionWorkerAssignment;
    HcmPositionDetail             hcmPositionDetail;
    HcmPosition                   hcmPosition;
    HcmJob                        hcmJob;
    OMOperatingUnit               oMOperatingUnit;
    ;

    select hcmWorker where hcmWorker.Person == 5637144585
    join dirPartyTable where dirPartyTable.RecId == hcmWorker.Person
    join hcmPersonPrivateDetails where hcmPersonPrivateDetails.Person == hcmWorker.Person
    join hcmEmployment where hcmEmployment.Worker == hcmWorker.RecId
    join dirPartyLocation where dirPartyLocation.Party == dirPartyTable.RecId
    join logisticsPostalAddress where logisticsPostalAddress.Location == dirPartyLocation.Location;

    select dirPartyLocation where dirPartyLocation.Party == dirPartyTable.RecId
    join logisticsLocation where logisticsLocation.RecId == dirPartyLocation.Location
    join logisticsElectronicAddress where logisticsElectronicAddress.Location == logisticsLocation.RecId
    && logisticsElectronicAddress.Type == LogisticsElectronicAddressMethodType::Phone;



    while select hcmPositionWorkerAssignment where hcmPositionWorkerAssignment.Worker == hcmWorker.RecId
    join hcmPosition where hcmPosition.RecId == hcmPositionWorkerAssignment.Position
    join hcmPositionDetail  where hcmPositionDetail.Position == hcmPosition.RecId
    join hcmJob where hcmJob.RecId == hcmPositionDetail.Job
    join oMOperatingUnit where  oMOperatingUnit.RecId == hcmPositionDetail.Department
          && oMOperatingUnit.OMOperatingUnitType == OMOperatingUnitType::OMDepartment
       {
            info(strFmt("Name of Worker : %1 , Date of Birth : %2 , Date Of Joining : %3 , Address : %4 , Phone : %5, Department : %6 ,  Postion : %7 , Designation : %8 , Job : %9" ,
            dirPartyTable.Name,hcmPersonPrivateDetails.BirthDate,hcmEmployment.ValidFrom,logisticsPostalAddress.Address,logisticsElectronicAddress.Locator,
            oMOperatingUnit.Name,hcmPosition.PositionId,hcmPositionDetail.Description,hcmJob.JobId));
       }


 }

No comments:

Post a Comment