Skip to main content

Notifications

How to get workers of different type.

GirishS Profile Picture GirishS 27,832 Super User 2024 Season 1

Hi,

In this blog we will learn how to get worker of different based on the types. It includes following types.

You can use that appropriate query in the code to get the worker list based on the types.

Worker type Query to be used Explanation
Employee HcmWorkerListPage_Employees This will return employee on the current company.
Contractors HcmWorkerListPage_Contractors This will return all the contract employees.
Workers HcmWorkerListPage This will return all the workers irrespective of legal entity.
Past workers HcmWorkerListPage_PastWorkers This will return all the workers who is not having position or active employment.
Pending workers HcmPendingWorkers This will return list of workers who is having future employment start date.
Probation workers HcmWorkerListPage_ExpiringProbation This will return list of workers who is having probation period.
Inactive workers HcmWorkerListPage_Inactive This will return list of workers who is not having active employment.

You can use that static AOT query in the code to get the list of workers. For example, I want all the workers who is in current company. So, in that case we need to use "HcmWorkerListPage_Employees".

Query qery = new query(queryStr(HcmWorkerListPage_Employees));
QUeryRun qRun;
qRun = new QueryRun(query);
while(qRun.next())
{
    //get your tables used in the query datasource and get your results.
    HcmWorker worker = qRun.get(tablenum(HcmWorker));
}

Thanks.

Comments

*This post is locked for comments