Hey Team,
I'm rehiring employees and therefore I need the last issued Position Id for that employee. I have the personnel number of that employee so how can I find the most recent position for that employee using the Personnelnumber? Please help me with this issue.
Hi Skd,
Did you check the worker Position assignment screen to check the Position ID:
Data Source: HcmPositionWorkerAssignmentData Field: Position
Hey Junaid Idrees,
I want to do this through x++.
Hi skd,
Please check the following code:
HcmWorker hcmWorker; HcmPosition hcmPosition; HcmPositionWorkerAssignment hcmPositionWorkerAssignment; select firstonly hcmWorker where hcmWorker.personnelNumber == 000001; // Personnal number hcmWorker.name())); // worker Name info(strfmt(“Department Name :%1”,hcmWorker.primaryDepartmentName(); // department name select * from hcmPositionWorkerAssignment where hcmPositionWorkerAssignment.Worker == hcmWorker.RecId; info(strfmt(“Start date :%1”, DateTimeUtil::date(hcmPositionWorkerAssignment.ValidFrom))); // Start date select * from hcmPosition where hcmPosition.RecId == hcmPositionWorkerAssignment.Position; info(strfmt(“Position name :%1”, hcmPositionDetail::find(hcmPosition.RecId).Description)); // Position Name
Hey Will Wu,
I tried the above code but it's not giving me position of past workers, which is a problem. As I want to rehire those employee who have been terminated, so can you give me a solution to this?
This was the result I got when I tried to get position of the past worker:
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
CA Neeraj Kumar 2,029
André Arnaud de Cal... 871 Super User 2025 Season 2
Sohaib Cheema 582 User Group Leader