You can script the Find/Replace command in all of its interactive forms just as you can scrip the Find (query) of FMP.
Most users would use a global field for the search criteria.
Having problems with the script. I made the gworkcode and wrote the following script do know where I am going wrong?
go to layout
enter find mode
set field [dbe listing::gworkcode]
Thank you for your help
Assuming that your table is "dbe listing" and your global field is "gworkcode", and further calling the field you are trying to search "datafield"
go to layout [ layout you want to go to ]
enter find mode
set field [ Datafield ; dbe listing::gworkcode]
You told FMP what you wanted to set the field to...but not what field you wanted set.
Thanks but this is where I am lost. I'm not really searching a data field, I'm just searching for some text that has been pasted into a layout. Basically I trying to do the same thing as the find/replace command under the edit menu. I just trying to have it right above the list of text so users don't have to access the menu bar.
Let em know if I headed in the right direction or what i could do, I appreciate all of your help.
You do not need "Find Mode".
The only step "required" in this new script is "Find/Replace" - there is a dialog that is identical to the interactive find/replace.
In that dialog you can specify by calculation the global field and indicate the type of find etc.
Attach this script to a button or onobjectexit trigger to the global field for automatic execution.
Hope this is the direction you are seeking.
Thank you, I understand where your going with this now but what calculation do I specify to make the find look for what is text is placed in the gworkcode field. I picked that field in the specify box and place the script on a button but it only went to the gworkcodes field not to the text below which is not in a field at all just pasted to the layout.
The "Find What" is where you specify your global field.
Find/Replace behavior will vary from layout to layout based on several factors.
It is most commonly used when the layout is list or table view but it will perform in form view - it is easier to debug the script behavior in list or table view.
Is the data you want to search in fields of the table that the layout is assigned to and are they visible on the layout?
What are your choices in the scripted script step "Perform Find/Replace", i.e. Current Field, All Fields, Current Record, All Records, etc.?
Did you check the "Perform without dialog" option? It needs to be checked.