Extract Excel file after filtering Start Date and End Date

Hello, is there anyone who can see the possible error / issue in my code why I can't generate the data after filtering the EmpID, startDate, and endDate in excel file?

When I Only filter it with EmpID, it generates correctly in excel file. Otherwise, it will generate all data in the excel file.

Also, is it possible to generate the excel file it without using "Search" button? Thanks in advance.

Below are my codes:

=load(
local!pagingInfo: a!pagingInfo(
startIndex: 1,
batchSize: -1
),

local!hiredate,
local!city,
local!firstName,
local!lastName,
local!email,
local!empID,
local!gridselection: a!gridSelection(
selected: null,
pagingInfo: local!pagingInfo
),
local!startDate,
local!endDate,
local!exportDocId,
local!canSearch: true,
local!activityDataSubset: todatasubset(
{},
local!gridselection.pagingInfo
),
local!activityData: index(
local!activityDataSubset,
"data",
{}
),

with(
local!agentHRRoster: rule!APP_RULE_GetAgentHRRosterImportInformation(
EmpId: local!empID,
FirstName: local!firstName,
LastName: local!lastName,
PrimaryWorkEmail: local!email,
LocCity: local!city,
HireDate: local!hiredate,
StartDate: local!startDate,
EndDate: local!endDate,
fetchTotalCount: false(),
pagingInfo: local!pagingInfo

),
a!sectionLayout(
label:"HR Roster Import",
contents:{
a!boxLayout(
label: "Search Criteria",
contents: {

a!columnLayout(
contents: {
a!pickerFieldUsers(
label: "Agent Code",
labelPosition: "ABOVE",
value: local!empID,
saveInto: {
local!empID,
a!save(
local!canSearch,
true()
)
},


)
}
),
a!columnLayout(),
a!columnLayout(
a!sideBySideLayout(
items: {
a!sideBySideItem(
item: a!dateField(
label: "Start Date",
value: local!startDate,
saveInto: {
local!startDate,
a!save(
local!canSearch,
true()
)
},
)
),
a!sideBySideItem(
item: a!dateField(
label: "End Date",
value: local!endDate,
saveInto: {
local!endDate,
a!save(
local!canSearch,
true()
)
},
)
)
}
)
)
}
),
a!buttonArrayLayout(
buttons: {
a!buttonWidget(
label: "Search",
saveInto: {
a!save(
local!gridselection,
a!gridSelection(
pagingInfo: a!pagingInfo(
startIndex: 1,
batchSize: -1,
sort: a!sortInfo(
field: "EmpID",
ascending: fn!false()
)
),
selected: null
)
),
a!save(
local!activityDataSubset,
todatasubset(rule!APP_RULE_GetAgentHRRosterImportInformation(
EmpId: local!empID,
FirstName: local!firstName,
LastName: local!lastName,
PrimaryWorkEmail: local!email,
LocCity: local!city,
HireDate: local!hiredate,
StartDate: local!startDate,
EndDate: local!endDate,
fetchTotalCount: false(),
pagingInfo: local!pagingInfo
))

),
a!save(local!exportDocId,null),
a!save(
local!activityData,
index(
local!activityDataSubset,
"data",
{}
)
),
a!save(
local!canSearch,
false
)
},
style: "NORMAL",
disabled: if(
local!canSearch,
false,
true
)
),
a!buttonWidget(
label: "Clear",
saveinto: {
a!save(
local!gridselection,
a!gridSelection(
pagingInfo: a!pagingInfo(
startIndex: 1,
batchSize: 10,
sort: a!sortInfo(
field: "empID",
ascending: fn!true()
)
),
selected: null
)
),
a!save(
local!empID,
null
),
a!save(
local!startDate,
null
),
a!save(
local!endDate,
null
),
a!save(
local!activityDataSubset,
todatasubset(
{},
local!gridselection.pagingInfo
)
),
a!save(
local!activityData,
index(
local!activityDataSubset,
"data",
{}
)
),
a!save(
local!canSearch,
true
)
},
style: "NORMAL"
)
},
align: "END"
),

rule!APP_FRM_downloadExcelLinkForHRRosterImport(
EmpId: local!empID,
exportDocId:local!exportDocId,
StartDate:local!startDate,
EndDate:local!endDate

),
a!gridField(
data: local!agentHRRoster,
label: "HR Roster Import Data",
data: local!agentHRRoster,
columns: {
a!gridColumn(
label: "ID",
value: fv!row.pk_id
),

a!gridColumn(
label: "Agent Code",
sortField: "Agent Code",
value:a!linkField(
links: a!recordLink(
label: fv!row.EmpID,
recordType: cons!APP_CON_RecordType_HR_ROSTER,
identifier: fv!row.pk_id
)
)
),
a!gridColumn(
label: "First Name",
sortField: "First Name",
value: fv!row.firstName
),
a!gridColumn(
label: "Last Name",
value: fv!row.lastName
),
a!gridColumn(
label: "Email",
value: fv!row.primaryworkEmail
),
a!gridColumn(
label: "Hire Date",
value: fv!row.hiredate
),
a!gridColumn(
label: "City",
value: fv!row.locCity
)
},
pageSize: 10,
pagingSaveInto: fv!pagingInfo

)
}
)
)

)

  Discussion posts and replies are publicly visible

Parents Reply Children