Try it this way.
Define a global field, gCustomerNo. To define a global field, open its field options and click the storage tab to change it to global storage.
Now change your script to be:
Go to Layout
Show Custom Dialog [//specify gCustomerNo as the input field]
Enter find mode //clear the pause checkbox
set field [Yourtable::CustomerNoField ; YourTable::gCustomerNo]
Set Error Capture [on] // keeps the no records found dialog from popping up in the middle of your script
I don't know if it was an oversight in your script, or an oversight in your post above...but you never entered Find Mode.
Put the step "Enter Find Mode" just prior to the Show Custom Dialog.
Thanks for noticing. I had just omitted it when retyping for the post.
Of course, your solution worked perfectly. You are awesome and saved me "again". Can you please explain why I had to build a new field instead of using my current one?
Ninja's suggestion does work. I just tested a script to be sure as I don't normally use custom dialogs with scripted finds:
Enter Find Mode [ ]
Show Custom Dialog [ Title: "enter a value"; Buttons: “OK”; Input #1: CustomDialogFindExp::field, "a fruit please:" ]
Perform Find [ ]
worked just fine in my test.
Yes, it did work. I had to change the way I had my custom dialog set up; but, it finally worked.
Thank you both so much! I am moving to a new position within the company next week and am trying to "dummy proof" the database a little more before leaving it in someone else's hands.
Have a GREAT evening!
As odd as it may seem ;) the use of custom dialog inside a search script is given as an example of how to use the custom dialog feature in the on-board help in FMP8. Dunno if it is still there in later versions.
My only beef with using Show Custom Dialog for is that its input fields are too limited. Validation has to take place after the dialog is dismissed and you can't format the input field with a value list, or other control. As a result, I usually use either the new window command with all its quirks to pop up a small floating window or switch to a dedicated search layout.
I reserve a custom dialog with an input field for just a few uses where the input is simple text only.