I'm trying to resolve an issue with my sample search function. When performing a search between two dates without specifying a field, it works perfectly. However, when I include a specific field such as "status: working," the QuickFind returns results for both "working" and "not working." Interestingly, searching for "not working" works perfectly. I'm unsure where the issue lies in the script and need assistance in identifying the problem.
Agreed with the explanation and suggestion that @mipiano posted.
Additionally:
It looks as though possibly find criteria are being set both at line 25 and line 27. The way that it has been set up is probably not causing any unexpected results, but, if the Find Records step at line 27 has been configured as shown in the screen capture, then I believe that would make line 25 unnecessary.
Some devs prefer the Find approach of entering Find mode and then using Set Field script steps (like line 24). Other devs prefer the approach of defining the Find criteria within the Perform Find [Restore] script step (line 27). I'm not thinking to try to steer you to one approach or the other, but I do wish to point out that the current combination of using both could cause some confusion to anyone maintaining the script at some time in the future.
Re: "After deleting line 25, the script works perfectly."
You are deleting the wrong line. It is far easier to debug a Find if the criterion is set specifically, as in line 25. What you should do is remove the [Restore] option in line 27.
going back to the original question, another option you could try is search for "not", and perhaps omit to return the records that do not contain that word.
Slight tweak to that. Rather than "==$Status", you are going to want:
"==" & $Status
Have the variable inside the quotes will search for that literal text with the dollar sign. You need to have it outside of the quoted double equals, then concatenate it with the ampersand.