Paging in the grid creates the problem

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 

Type Description Country
Nameabc1 abc

Brasil , India

nameabc2 def

Nepal

nameabc3 das

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