Merhaba arkadaşlar,
Dynamics Ax‘ta bir çalışanın, bulunduğu pozisyon, departmanı, ünvanı vs gibi bilgilerini almak istersek, aşağıda ki kod işimizi görecektir;
static void SMHWorkerPositionDetail(Args _args) { HcmWorkerRecId hcmWorkerRecId; HcmPositionWorkerAssignment hcmPositionWorkerAssignment; HcmPositionDetail hcmPositionDetail; OMOperatingUnit omOperatingUnit; ; hcmWorkerRecId = HcmWorker::userId2Worker(curUserId()); hcmPositionWorkerAssignment = HcmPositionWorkerAssignment::getActivePositionWorkerAssignment(hcmWorkerRecId); hcmPositionDetail = HcmPositionDetail::findByPosition(hcmPositionWorkerAssignment.Position); omOperatingUnit = OMOperatingUnit::find(hcmPositionDetail.Department, OMOperatingUnitType::OMDepartment); info(strFmt("Pozisyon: %1- Departman: %2", hcmPositionWorkerAssignment.description(), omOperatingUnit.Name)); }