December 5, 200322 yr 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,
December 5, 200322 yr 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.
December 5, 200322 yr 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.
December 5, 200322 yr Author 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.
December 10, 200322 yr 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?
December 10, 200322 yr 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.
Create an account or sign in to comment