D365FFO – AX – Worker line manger x++

static void WorkerLineManager(Args _args)
HcmPosition hcmPosition,hcmPositionLoc;
HcmPositionDetail positionDetail;
HcmPositionWorkerAssignment workerAssignment,workerAssignmentLoc;
HcmPositionHierarchy positionHierarchy, positionHierarchyLoc;
HcmWorker hcmWorker,hcmWorkerLoc;

select positionHierarchy
join hcmPosition
where hcmPosition.RecId == positionHierarchy.Position
join workerAssignment
where workerAssignment.Position == hcmPosition.RecId
join hcmWorker
where hcmWorker.RecId == workerAssignment.Worker
&& hcmWorker.PersonnelNumber == “891”;

select positionHierarchyLoc
join hcmPositionLoc
where hcmPositionLoc.RecId == positionHierarchy.ParentPosition
join workerAssignmentLoc
where workerAssignmentLoc.Position == hcmPositionLoc.RecId
join hcmWorkerLoc
where hcmWorkerLoc.RecId == workerAssignmentLoc.Worker;

info(strFmt(“%1–line manager %2”, hcmPositionLoc.PositionId,hcmWorkerLoc.PersonnelNumber));

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s