Hi Everyone ,
When try to keep the batchSize in the paging info , it display that the totalnumber has been exceeded by largest column data
My table looks like
Brasil , India
Nepal
Australia,USA
load( local!defaultPagingInfo: a!pagingInfo( startIndex: 1, batchSize: - 1, sort: { /* Default to sort in reverse chronological order */ a!sortInfo( field: "Type", ascending: false ) } ), local!pagingInfo: local!defaultPagingInfo, with( local!datasubset: todatasubset( a!foreach(items : rule!TAS_generateDataSubset(ID: ri!IDnum), expression : fv!item.data), local!pagingInfo), { a!gridField( label: "Deal Collateral", labelPosition: "COLLAPSED", totalCount: local!datasubset.totalCount, emptyGridMessage: resource( "No Collateral available" ), columns : { a!gridTextColumn( label: resource("Type"), field: "Type", data: a!forEach( items: local!datasubset, expression: a!forEach( items: fv!item.data, expression: a!forEach( items: fv!item, expression: index( index( fv!item, "Type", null ), "name", null ) ) ) ) ), a!gridTextColumn( label: resource( "Description" ), field: "description", data: a!forEach( items: local!datasubset, expression: a!forEach( items: fv!item.data, expression: a!forEach( items: fv!item, expression: index( fv!item, "description", null ) ) ) ) ) ) }, value: local!pagingInfo, saveInto: { local!pagingInfo }, ) )
2. a!foreach(
items : rule!TAS_generateDataSubset(ID: ri!IDnum),expression : fv!item.data)
Returns ==> [Type=[id=1, name=nameabc1], country=[id=Bra, name=Brasil]; [id=Ind, name=India], description=abc];[Type=[id=2, name=nameabc2], country=[id=Nep, name=Nepal], description=Testing def]Can anyone help me in paging the correct way .
Discussion posts and replies are publicly visible
I think the issue is with the country column, since that contains a list of lists. I'd suggest updating your expression to cast the full list of countries for the given row to a single string like this:
a!gridTextColumn( label: resource("Country"), field: "country", data: a!forEach( items: local!datasubset, expression: tostring( index( fv!item, "country", "" ) ) ) )
It's actually decently rare to need many nested a!forEach() functions, so usually there is a simpler solution rather than having to nest all of those together so many times!