Well kinda, sorta, but with some limitations.
You can use
To select and highlight a specific section of a text field. This will not enable you to highlight multiple instances of a keyword and if the field is editable, your user is now one key stroke away from changing the contents of the highlighted text.
You can use
In a calculation field
To show every instance of Keyword in textfield as Bold, but it is unfortunately case sensitive. Which means that
will show apple in bold face throughout the text field, but "APPLE" and "Apple" will not be shown in bold.
I was wondering if it is possible to find within a specific field of a record
give a look to the Edit >> Find/Replace menu command.
It can be full customised and even scripted.
I believe Perform Find/Replace would be your best option.
Highlighting, though possible*, is problematic because it requires a calculation. You would either need to modify the contents of the field, or display the highlighting in another field.
Wow. It must have been a really long time since I have worked in FileMaker. I cannot figure out the simplest of things! I am trying to write a script that will allow users to perform the find/replace, but I can't get it to work. I've scripted it to go to the specific field, then perform find/replace, but it doesn't work. What am I missing? Other there other parameters that need to be in the script? It seems so simple .....
I've been researching this after the other posts came up. Try Open Find/Replace.
How would you like your users to specify what to find?
I think the Open Find/Replace will work just find. I will just have to train the users to make sure they choose the proper options.
"I will just have to train the users to make sure they choose the proper options."
That isn't the correct way to go on...
Let say that you have:
1) a text field ( Text ) that contains the text to be searched
2 ) another text field ( Find ) where the user insert by hand the text to search
1) Into the auto-enter option for the field "Text" insert this calculation:
TextColorRemove ( Text )
2) write down this script ( FindAll ):
Go to field [ YourTable:: Text ]
Perform Find/Replace [ No dialog ; Perform: Replace All ; Find what: YourTable:: Find ; Replace with: "§§§" ; Direction: All ; Match case ; Search across: Current record ; Search within: Current field ]
Insert Calculated Result [ Select ; YourTable:: Text ; Substitute ( YourTable:: Text; "§§§" ; TextColor ( YourTable:: Find ; RGB ( 255 ; 0 ; 0 ) ) ) ]
3) Attach that script to a button.
The result will be:
a) the user enters a word to search into the "Find" field
b) press the button
c) the field "Text" will show the searched word in red color ( and still have the focus )
d) exiting the field, it will revert to its previous status.
And if two users are trying to do this in the same record?
I do not know if there will be problems.
I haven't much experience with multi-user scenario.
There isn't a record locking ?
There isn't a record looking ?
Of course there is, if you're modifying the field contents. What's worse, after you commit the record, the last user's search phrase will be highlighted for all users.
What's worse, after you commit the record, the last user's search phrase will be highlighted for all users.
But committing the record do not fires the evaluation of the auto-enter calc ?
IOW, the other users will be able to access the record ONLY after the committing ( and the consequent retrieval of the pre-situation ).
Do not ?
I will just have to train the users to make sure they choose the proper options.
Good luck with that…
I'd do it this way (given a Content field to search and a global gSearchPhrase field containing the search phrase):
If [ IsEmpty ( Get ( ActiveFieldName ) ) ]
Set Selection [ Table::Content; Start Position: 0; End Position: 0 ]
Perform Find/Replace [
Search operation: Find Next;
Search settings: All;
Search across: Current record/request;
Search within: Current ﬁeld ]
[ No dialog ]
IOW, the other users will be able to access the record ONLY after the committing
Yes, that's correct. So the "only" problem is that while one user is viewing the highlights, the record is locked.