todatasubset() not returning the correct total count when batch size is 0

Certified Lead Developer

So I appended 2 List of Dictionaries in a local variable and then did a todatasubset() on this local variable with a batch size of -1 and the total count was correct. When I changed the batch size to 0, the total count returned 0 when I was expecting it to return the same total count as when I passed in -1 for the batch size. Any ideas on why this is happening or what I'm doing wrong?

  Discussion posts and replies are publicly visible

Parents
  • Hi there,

    Please run this code

    load(
    local!x1:{{id:1,name:"name1"},{id:2,name:"name2"}},
    local!x2:{{id:3,name:"name3"},{id:4,name:"name4"}},
    local!x3:append(local!x1,local!x2),
    local!ans1:todatasubset(local!x3,a!pagingInfo(startIndex: 1,batchSize: 0)),
    local!ans1
    )


    please change batchSize to 1,-1 2 ,4
    You will notice that totalCount remains same. That is 4.
    Let me know if this code helped you.

    Thanks!
    Mayur Mondhe
Reply
  • Hi there,

    Please run this code

    load(
    local!x1:{{id:1,name:"name1"},{id:2,name:"name2"}},
    local!x2:{{id:3,name:"name3"},{id:4,name:"name4"}},
    local!x3:append(local!x1,local!x2),
    local!ans1:todatasubset(local!x3,a!pagingInfo(startIndex: 1,batchSize: 0)),
    local!ans1
    )


    please change batchSize to 1,-1 2 ,4
    You will notice that totalCount remains same. That is 4.
    Let me know if this code helped you.

    Thanks!
    Mayur Mondhe
Children
No Data