Skip to main content
Known Participant
Jul 24, 2024 12:58 PM UTC
Question

Pagination in todatasubset

Hi Champ,

I have a map variable and the same is used in the table. So I can see it was coded as todatasubset to the map variable with a local defined pagination variable. It's working fine if the map is having less no of rows then pagination ;but getting errorrdout when it's having more rows..message says like "batc size was 0 but te largest column data array had 12 items."

So FYI: We are not using datasubset rather using todatasubset.

Regards,

Ghanashyam

19 replies

stefanhelzle0001
Brainy
Jul 24, 2024 1:43 PM UTC

I do not fully understand. Can you share some code snippets explaining what you are doing?

konduruc733182
Inspiring
Jul 24, 2024 2:20 PM UTC

Please share the code snippet of what you have configured and the error box screenshot if possible. 

Known Participant
Jul 24, 2024 2:45 PM UTC

Please find the error screenshot along with the code snippet

I just put some portion of the code needed to debug this

a!localVariables(
local!paginInfo:a!pagingInfo(
startindex: 1,
batchSize: 10
),
local!mapDataSubset: a!dataSubset(
startIndex:local!paginInfo.startIndex,
batchSize:local!paginInfo.batchSize,
totalCount:count(index(ri!map,"abc",{})),
sort:a!sortInfo(
field:"abc",
ascending:true
),
data:ri!map,
identifiers:index(ri!map,"abc",{})
),
a!gridField(
label: "label",
labelPosition: "ABOVE",
data: local!mapDataSubset,
pagingSaveInto:local!paginInfo

)

stefanhelzle0001
Brainy
Jul 24, 2024 3:01 PM UTC

When creating a data subset using a!datasubset(), you have to make sure that the number of items in "data" matches the batchsize parameter.

Known Participant
Jul 24, 2024 3:03 PM UTC

As I am having pagination in my grid..how can I make it data to be changed dynamically based on pagination?