The best method is the one that always works for you and your users. It depends on your needs. A scripted find or a dynamic find-same for Omit and Sort?
Do you want to enter find mode, have the user enter the requirements, or do you want to go to a find layout and restrict or guide the user?
Phil has many examples of scripted finds posted to a thread, plus I think they are covered in one or more of his Adventures in FileMaking series
Finds aren't at this time covered in the Adventures series, but I do have a thread of scripted find examples: Scripted Find Examples
A typical scripted find to do what you want has at least two find requests, the first finds your records and the second specifies which of those matching records to omit if they match additional criteria. Then you add a sort records script step after the perform find to sort them as desired.
But of course, there are many variations possible of that basic outline including using constrain found set and extend found set to further refine the found set produced by an initial find.
Steve - Right now the layout is for user display only, I only want specific data from the table occurrence associated the layout. I currently have a layout script trigger "On Layout Enter" that performs the first find. I've been unsuccessful with adding criteria "Specify Find Requests" as well as script steps.
Phil mentioned a second step to specify which of the matching records to omit and I understand this, but the question I have is where does this second step go? Is it an additional find script step with omit criteria or is the omit criteria added to the original find step?
Please open and read the recommended link. There are script examples there that do this using the new record/request and omit records steps.
Another example shows how to use Constrain Found Set, which could also be used.
Adding the Omit Record step while in Find Mode will toggle the Include/Omit status of the current Find request – exactly the waxy it does in “manual mode”.
What your script above does is omit all records where both criteria are true.
If you want to find all record where criterion 1 is true, and from the resulting found set omit all records where criterion 2 is true, you need
Set Variable [ $id ; Table::boardNo ]
Set Variable [ Globals::xStatus ; "Sold" ]
Enter Find Mode
# do this before the layout change, so you don't load records unnecessarily
Go to Layout [ RetailViewForm ( T07Inventory ) ]
Set Field [ T07Inventory::boardNo ; $id ]
# adds a new request
Set Field [ T07Inventory::HS ; Globals::xStatus ]
# toggles only this request to “omit”
Set Error Capture [ on ]
If [ not Get ( FoundCount ) ]
Go to Layout [ original ]
Show Custom Dialog [ "No matching records" ]
Sort Records [ ]
Thanks for the help!