web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Blogs / FT Dynamics AX blog / A job to get the position o...

A job to get the position of an employee

dolee Profile Picture dolee 11,279
                
static void GetPosOFEmployees(Args _args)
{
HcmWorker hcmWorker;
HcmPositionWorkerAssignment workerAssignment;
HcmPosition hcmPosition;
HcmPositionDetail hcmPositionDetail;

while select recid, person from hcmWorker
join worker, position from workerAssignment
where workerAssignment.Worker == hcmWorker.RecId
join recid from hcmPosition
where hcmPosition.RecId == workerAssignment.Position
join position, description from hcmPositionDetail
where hcmPositionDetail.Position == hcmPosition.RecId
{
info(strFmt("%1's position is %2",hcmWorker.name(), hcmPositionDetail.Description));
}
}
Note that HcmPositionWorkerAssignment is a validTimeState table. The above query will only retrieve position assignment that is currently active.
This posting is provided "AS IS" with no warranties, and confers no rights.

This was originally posted here.

Comments

*This post is locked for comments