Jump to content
Server Maintenance This Week. ×

Click word, brings to corresponding record


This topic is 3531 days old. Please don't post here. Open a new topic instead.

Recommended Posts

 I have a rather large database, and I want to be able to click on a word that is in one entry, and have it take me to that data entry. Is this possible? Would I need to create each individual link? Or is there a way to stream line this?

Let me know if that doesn't make sense, and I'll try to explain further what I want to do.

 

 

I asked around on the official file maker forums, but was never able to figure it out. They gave me a script which I got mostly working, but now can't get it to work.

 

I was wondering if there was another way to do this? Any help would be greatly appreciated.

 

Set Variable [$Cursor ; value: Get ( ActiveSelectionStart ) ]
Set Variable [$start ; value: $Cursor ]
Set Variable [$Text ; Get ( ActiveFieldContents ) ]
#Scan left
Loop
   Exit Loop If [PatternCount ( " ¶.?"!&,:" ; Middle ( $Text ; $start ; 1 ) // exit if character is a space, return or punctuation ]
   Exit Loop If [ $Start = 1 ]
   Set Variable [$Start ; value: $Start - 1 ]
End Loop
#Scan Right
Set Variable [$End ; value: $Cursor + 1 ]
Loop
   Exit Loop If [PatternCount ( " ¶.?"!&,:" ; Middle ( $Text ; $End ; 1 ) // exit if character is a space, return or punctuation ]
   Exit Loop If [ $End =  Length ( $Text ) ]
   Set Variable [$End ; value: $End + 1 ]
End Loop
Set Variable [$word ; value: Middle ( $Text ; $End - $Start ) ]
#Perform a Find
Go to Layout [specify layout based on table to be searched here]
Enter Find Mode []
Set Field [YourTable::YourFIeld ; $Word]
Set Error Capture [on]
Perform Find []

 

 
Link to comment
Share on other sites

I want to be able to click on a word that is in one entry, and have it take me to that data entry.

 

I am afraid that's not very clear. How about a simple example? You have a text field in a table of [?], it contains the following text "[?]", and when I click the word [?] I want to be taken to [?]. And why is this necessary?

Link to comment
Share on other sites

Sure! Sorry about that.

 

I have the text field Description, in a table of 17k+ records.  It contains Omni + Potent. When I click on the word Omni, I would like to be taken to the corresponding record Omni.

 

It's necessary to make navigating the database more efficient, as opposed to using the search function, as well as my boss was wondering if it was possible.

Screen_Shot_2013-10-09_at_3.29.17_PM.png

Link to comment
Share on other sites

If I understand this correctly, you have a structural problem here which you are trying to bypass, instead of solving it. Of course, with this little information I am mainly guessing, but it seems to me that a record of "Omnipotent" should have two related records, one of "Omni" and one of "Potent". These two records would be shown in a portal, and clicking on one of them would call the Go to Related Record script step to ... well, go to the related record.
 
Since the same word (e.g. "Omni") can be used in more than one word (e.g. "Omnipotent" or "Omnibus"), you will need to use a second table as a join table, so that your relationship graph will look something like:
 
Words -< Components >- ChildWords

 

or, if you also want to see which words the current word is a part of:

ParentWord -< Components 2 >- Words -< Components >- ChildWords

 

(the blue TOs are occurrences of the Words table, the green ones are occurrences of the Components join table)

  • Like 1
Link to comment
Share on other sites

BTW, just for fun, here's a slightly(!) simpler script to capture and find the clicked word:

# 1. CAPTURE CLICKED WORD
Set Variable [ $clickedWord; Value:
   Let ( [
   text = Get ( ActiveFieldContents ) ;
   textBefore = Left ( text ; Get ( ActiveSelectionStart ) )
   ] ;
   MiddleWords ( text ; WordCount ( textBefore ) ; 1 )
   ) ]
# 2. FIND IT
Perform Find [ Specified Find Requests: Find Records; Criteria: YourTable::Description: “$clickedWord” ][ Restore ]

But really, this is not a good way to proceed. You will encounter many other problems unless you fix your structure, esp. when it comes to reporting on your data.

Link to comment
Share on other sites

I've been trying for five minutes to double-click fast enough.  Does that make me a blonde?  I finally Googled your phrase and landed here and now I'm laughing my glasses off!!

 

http://www.devtopics.com/best-programming-jokes/

 

I haven't found Chuck in it yet but I see a lot of Chuck Norris jokes that fit.  i guess I'd better cancel my audition to the world Master's karate championship then.   Bummer.

Link to comment
Share on other sites

Could you explain what you mean by structure? Is it the layout of the records itself?

 

Would the same script apply for the Sign Family box? That's also where the scrip is going You click on the word Economy in Sign Family, and it brings you to that record.

 

vqksoo.png

 

If the scripting isn't viable, as it seems there will be countless problems, would hyperlinking the words work? Or is this something for FM Web Direct/publishing it online. 

Link to comment
Share on other sites

(Wasn't sure where to put this question, sorry if its in the wrong spot)

 

I saw an article about natively hyperlinking a record, to another record. Unfortunately I wasn't able to view the tutorial without paying an absurd subscription fee...

 

So I was wondering how this was possible? It can be done with custom functions and some fiddling around with things. But I'd love to know how to do it.

 

Any help would be great.

Link to comment
Share on other sites

Hi Jackie, and Welcome to the FM Forums,

 

I’m guessing you mean Hyperlinking Records by ISO Magazine. I find ISO Magazine to be an excellent resource for FileMaker developers and I’ve been a subscriber for many years. For a Quarterly subscription of $24.95,  you have  access to any and all of the articles and you can cancel your Subscription at anytime. 

 

Disclaimer, I have no affiliation with ISO other then being a subscriber.

Edited by Lee Smith
Disclaimer
Link to comment
Share on other sites

Could you explain what you mean by structure?

 

Okay, so obviously I have been mistaken about the nature of your database. I am not sure I understand it now (it's kind of difficult, having only two screenshots to go by).

 

Let me answer this in general: you should have a separate table for each class of objects (entity) you are tracking. For example, if you are making a dictionary, then you would have a table of Words (or, more precisely, headwords i.e. lexemes), where each word has one unique record. Now, if there are families to which words can belong to, then you would also have a separate table of Families, with a record per family.

 

The next question you need to ask yourself is what is the relationship between these entities? Possible answers are (a) one-to-many (each word belongs to one family only), or ( B) many-to-many (a family has many words, each word can belong to several families). If you answered ( B), you will need a third, joining table to implement the relationship.

 

The gist of this is that any time you have a "many" of something, that "many" needs to be comprised of individual records in a related table - not individual words (or paragraphs, or anything) in a text field. And you show these records in a portal, where each one occupies a row of its own that can be clicked - without any trickery required to select the clicked needle in a text haystack.

Link to comment
Share on other sites

This topic is 3531 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.