Setting up and using a global counter

Post Reply
netaware
Member
Posts: 34
Joined: Tue Jul 30, 2024 7:11 pm

Setting up and using a global counter

Post by netaware »

Hello,
I want to setup a global counter, so when the counter hits specific number, i want to send email (problems jobs for testing).
But it keeps failing when it gets to the line to set the global data.
It fails at the "s.setGlobalData("myCounter", counter.toString());"

Anu ideas why?

This is a sample of my script:

var counter = parseInt(s.getGlobalData("myCounter", "0"));
counter++;
s.setGlobalData("myCounter", counter.toString());
If (counter === 10){
job.sendToData(3, job.getPath() );
}
Post Reply