I’m trying to work out a complex boundary script, but I’m starting simple, and that is just to emulate a record count of two. Every two CSV records becomes a “data page”, or in other words, set a boundary every 2 records. What the script below achieves is 1 CSV record in the first Data Model record, and every subsequent is correctly at 2 CSV records.
What’s wrong with my loop logic that causes it to fail on the first iteration?
var i;
if (boundaries.getVariable("counter") != null)
{
i = boundaries.getVariable("counter");
}
else
{
i = 1;
}
if (i == 2)
{
boundaries.set();
i = 1;
}
else
{
i = i + 1;
}
boundaries.setVariable("counter",i);