Thank you for your post.
If no records are found, then you will be unable to use Set Field to put the contents of $find into Untitled::Show. Instead of storing Get (LastError), after the Perform Find script, insert:
If [ Get (FoundCount) = 0 ]
In essence, if no records are returned by Perform Find, then you can perform a set of script steps.
Let me know if you need additional clarification.
Did you set the storage option of "Show" field as "global" ?
I can see the problem now. I never got zero found records to begin with. Finding duplicates doesn't work with constraining a found set (or two simultaneous search criteria). It will always search for duplicates in all records. I wanted to narrow my set down to child records from one parent record and then find duplicates within that found set. This is either a bug or a strange intention of the developers.
Have you tried using Constrain Found Set instead of Perform Find?
Just tried constrain, but to no avail.
"Just tried constrain, but to no avail."
A better statement would be:
I tried constrain but my script didn't work.
Here is my script (or my example file containing the script )
Can you help me correct it?
The primary key ( pk_whatever) should be unique.
If so, then the constrain step should not find any records.
So it looks like your script is working correctly.
But this is also why I really dislike using the [restore] option in FIND scripts.
It is impossible to troubleshoot.
Instead after the first find, perform the constrain but do NOT use [restore]
Enter Find Mode
Set Field [ whatever ]
Constrain Find 
Thanks for the fast reply. I tried your suggestion, but still the search for duplicates covers the whole range of records instead of the found set. Seems like no matter what, a "!" search request will search all records.
Didn't we just do this?
DO NOT tell us "I tried something but it doesn't work".
SHOW US EXACTLY EXACTLY EXACTLY WHAT YOU DID.
SHOW the complete script; or the file.
I thought this was such a minor change that there's no need to post another screen. Here you go.
In case you're wondering why I'm searching for duplicates in an fk field: I am searching in the table that holds all the single products that have been used in orders (the classic connection table for a many to many relationship, i.e. many orders, many products). I have two fk fields. One from the parent record that comprises the order and one from the table that holds all the products. My reasoning is that if I first limit my found set to one order, I should then be able to find duplicates of products in that one order. Hope that is understandable.
Using Constrain in exactly the way you have it in your script works fine here. What is it that "isn't working"? Give us the result you're expecting, and the result you're getting.