Query build range: while opening listpage form in EP

HI,

In this scenario, we need to get the data in EP for a list page form. Need to show the data(history) of log in employee and if the log in employee is a manager, need to how the data of his reporting employees under him.

1) to get the data on multiple record based on query range
2) get data for login employee & employees under him based on position reporting employees
if ((this.listPage().listPageArgs().menuItemName() ==
menuitemDisplayStr(Mzk_AlternativeLeave))) // 1. Alternative Leave
{

qbds = _query.dataSourceTable(tableNum(Mzk_AlternativeLeave));
categoryRange = SysQuery::findOrCreateRange(qbds, fieldNum(Mzk_AlternativeLeave, Worker));
categoryRange.status(RangeStatus::Open);

// Required by questionnaire form
qbds.addSelectionField(fieldNum(Mzk_AlternativeLeave, Worker));
if (hcmworkername)
{
categoryRange.value(queryValue(hcmworkername));
}
select * from HcmPositionWorkerAssignment
where HcmPositionWorkerAssignment.Worker == hcmworkername;

while select HcmPositionHierarchy
where HcmPositionHierarchy.ParentPosition == HcmPositionWorkerAssignment.Position
{
select * from HcmPositionWorkerAssignmentempl
where HcmPositionWorkerAssignmentempl.Position == HcmPositionHierarchy.Position;

select * from HcmWorkerreportingempl
where HcmWorkerreportingempl.RecId == HcmPositionWorkerAssignmentempl.Worker;

hcmworkername = HcmWorkerreportingempl.RecId;

_query.dataSourceNo(1).addRange(fieldNum(Mzk_AlternativeLeave, Worker)).value(queryValue(hcmworkername));
}
}

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s