Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7657 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have a script that finds a set of records. I want to go through that set and increment a series of counters, based on ZIP Code. I wrote a script (simplified to one ZIP only) as follows:

If ["ZIP Code = 90266"]

Set Field ["Undup Count 90266", "Undup Count 90266+1"]

Set Field ["Undup Count Non~BCHD", "Undup Count Not 90266+1"]

Go to Record/Request/Page [Exit after last, Next]

End If

The script runs, but the fields I want to increment do not return a value. The selected set of records totals 39, of which I know 2 are ZIP 90266.

I have tried putting the fields in the Body, Footer, and a Summary field, but none of that helps.

Could someone tell me what I'm doing wrong, and perhaps where to find a comprhensive article on setting up incremental counters in a script.

Thanks,

Posted

Is the Zip code field text or number? If it's text, the expression you have above in the IF won't work, because 90266 is a number.

Posted

It looks to me that your Go to Record/Request/Page step is in the wrong place. Because it's inside the If statement, it won't advance to the next record unless a match is found to that zip code. It should be after the End If step.

Posted

Actually, ZIP Code is a calculation from a field called ZIP Code Extended. We did that because only a few persons give you the full 10 space ZIP. However the calculation returns a number result.

So I tried creating a ZIP field that was a number, and hand entered the numbers for a test set of records. So the script reads:

If ["ZIP = 90266"]

Set Field ["Undup Count 90266", "Undup Count 90266+1"]

Set Field ["Undup Count Non~BCHD", "Undup Count Not 90266+1"]

Go to Record/Request/Page [Exit after last, Next]

End If

But that does not work either.

Posted

Sorry to aks what seem obvious questins.

Have you defined the Undup Count... fields as Global Number?

Do you initialise them to 0 before the If?

Posted

Just for debugging purposes, put a Pause script step immediately after the IF step. If your script doesn't pause, then the IF condition isn't evaluating the way you think it should.

And just for clarity's sake, this is part of a Loop script, right? I'm assuming it is, and you're just showing us a part of the script.

This topic is 7657 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.