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
  • 0
    Certified Lead Developer
    Hey Jamal,

    My guess is this is a data related issue of some sort. The below code returns 4 regardless of whether the batch size is -1 or 0, so I think your case must be a bit different. Please post your code for us to have a better idea.

    todatasubset(
    append(
    {
    {id: 1, name: "A"},
    {id: 2, name: "B"}
    },
    {
    {id: 3, name: "C"},
    {id: 4, name: "D"}
    }
    ),
    a!pagingInfo(1, -1)
    ).totalCount

    todatasubset(
    append(
    {
    {id: 1, name: "A"},
    {id: 2, name: "B"}
    },
    {
    {id: 3, name: "C"},
    {id: 4, name: "D"}
    }
    ),
    a!pagingInfo(1, 0)
    ).totalCount
Reply
  • 0
    Certified Lead Developer
    Hey Jamal,

    My guess is this is a data related issue of some sort. The below code returns 4 regardless of whether the batch size is -1 or 0, so I think your case must be a bit different. Please post your code for us to have a better idea.

    todatasubset(
    append(
    {
    {id: 1, name: "A"},
    {id: 2, name: "B"}
    },
    {
    {id: 3, name: "C"},
    {id: 4, name: "D"}
    }
    ),
    a!pagingInfo(1, -1)
    ).totalCount

    todatasubset(
    append(
    {
    {id: 1, name: "A"},
    {id: 2, name: "B"}
    },
    {
    {id: 3, name: "C"},
    {id: 4, name: "D"}
    }
    ),
    a!pagingInfo(1, 0)
    ).totalCount
Children
No Data