Skip to main content

Posts

Showing posts with the label hcmworker

How to change Company of Employee in Axapta by code

To change Company of Employee in Axapta by code you can get hint by below code. Its tedius task to update you need to do it very carefully and understand then code then apply in your customization. ttsBegin; hcmWorker=hcmWorker::findByPersonnelNumber(Personalumberid); select companyinfohsd where companyinfohsd.dataAreaId=="dat"; select companyinforss where companyinforss.dataAreaId=="ceu"; select forupdate hcmEmployment where hcmEmployment.Worker==hcmWorker.RecId && hcmEmployment.LegalEntity==companyinfohsd.RecId; hcmEmployment.LegalEntity=companyinforss.RecId; hcmEmployment.validTimeStateUpdateMode(ValidTimeStateUpdate::Correction); hcmEmployment.doUpdate(); ttsCommit;

Code to get Employee Name For all employee in Ax 2012

 To get Employee Name For all employee in Ax 2012 You can get idea from below code. DirPerson dirPerson; HcmWorker hcmWorker; HRMDailyAttendance hrmDailyAttendence; ; while select Name ,gender from dirPerson join hcmWorker group by dirPerson.Name,dirPerson.Gender where hcmWorker.Person == dirPerson.RecId { info(strFmt("%1",dirPerson.Name)); }