I suggest that you post a screen shot of the scripts workspace to show the exact way that you've set up this script if the following does not help you.
Set field has three parts: The target field, the repetition, the calculated result. For what you want, you need to leave the repetition at it's default setting of 1. I am guessing from the error code that you put "=No" as a calculation for the repetition instead of for the calculated result. Your set field step should look like this:
Set Field [TableOccurrence::FieldName ; "=No"]
If you see an extra pair of [ ], then you have put "=No" into the repetition instead of as the calculated result.
Perform Find/Replace is a different (and incorrect) step from
Remove the = sign and use field = "No".
you are finding No's in another layout and when you return, it is a different layout with different context. Is that what you meant to do?
I find it easier to create a value list called One whose only value is one. I use this instead of yes or no.
Then the field can be set to show yes or no via naming the field etc.
Counting the instances of 1 is now just sum(field).
It is a 5 second problem to rename the text label to yes or no... and to drag the right side of the checkbox object so that the name doesn't show.
Yes, Stephen... good point!
Select a layout where you have the field displayed as a checkbox with Yes or No.
Perform a find selecting No.
Open a script and create the line Perform Find and click on Specify Find Request. This one script step will find your NO or your Yes records.
That's not one I can agree with. Stored Find criteria buries the details inside some dialogs. When you review a script, you can't see those details without stopping to open those dialogs as well as not being as flexible as the current approach. It just needs a few of those details fixed.
I used to make the same argument about not using the single line perform find but I have since become even lazier and have begun using it almost exclusively. It's a great debugging tool since if the find worked, the perform find should also work and I don't have to worry about typos with the set fields.
BUt in this wonderful world we have the ability to use our own choice and not tell anyone about it.
and not tell anyone about it.
but obviously not you or I as we both told people about it.
I think the change of layouts is not relevant, but the Perform Find/Replace is the wrong script step. I'm assuming you already made that changed and my comments are directed at some other responses below.
The suggestion to perform the find manually and then insert the script step is a great one. It is a technique that goes all the way back to the first version of FileMaker, perhaps a decade before Claris acquired FileMaker. You had to do the thing before you could script it. It wasn't until FileMaker 7 that we wer able to write those script steps explicitly.
I'm on the fence about whether or not to include the find or omit conditions in the Perform Find script step. Ever since version 7, I have preferred that method because it keeps scripts from becoming unnecessarily lengthy, but the thing that I dislike about it is something that wasn't mentioned here, and that is the fact that you can't drag the find or omit conditions up or down in sequence. Typically you want to cast a wider net and then narrow down with the omits occurring after the finds. If you ever have to modify a Perform Find that has those items written into it, you can't do that. You have to always create them in sequence. So that's one reason why entering the Find Mode and specifying each find or omit with a Set Field step is preferable. It also allows you to disable one or several of them if necessary and that's easier than re-writing the step.
On the other hand, if you have a script where Perform Find occurs several times, such as inside an IF/ELSEIF set of script steps, the script length gets to be a nuisance, particularly with the awful new behavior of Script Debugger in FileMaker 16,but that's another story.
.... because it keeps scripts from becoming unnecessarily lengthy...
Wouldn't it be great if FileMaker 17 gave us the ability to collapse logical sections of scripts? That would solve the length problem....