Question
Sort foreach Data
Can anyone please hep me in this?
I want to sort below mentioned data. I was trying to sort data using queryentity and it worked. But I have to use rule input ri!employee(Type: Data Type). Please assist.
Need to sort data by these fields:
sort: {
a!sortInfo(field: "empcode", ascending: true()),
a!sortInfo(field: "type", ascending: true()),
a!sortInfo(field: "amount", ascending: true()),
}
joinarray(
a!forEach(
items: ri!employee,
expression: concat(
"",
"",
union(
{ fv!item.empcode },
{ fv!item.empcode }
),
" ",
"",
if(
rule!GLB_isBlank(fv!item.barcode),
{},
a!localVariables(
local!code: union(
{ fv!item.barcode },
{ fv!item.barcode }
),
local!newcode: split(local!code, "_"),
local!newcode[2]
)
),
" ",
"",
union(
{ fv!item.empname },
{ fv!item.empname }
),
" ",
"",
fv!item.type,
" ",
"",
fixed(
abs(index(fv!item,"amount",{})),
2
),
" ",
" "
)
),
char(10)
)
