AnsweredAssumed Answered

"Highlight" Text in Field Based on Relationship

Question asked by ShaunHamid on Nov 7, 2017
Latest reply on Nov 14, 2017 by ShaunHamid

I have a global search field (listfind) on a table occurrence {Design_listfind} of my main table {Design}. (listfind) is set to equal a field on {Design}   named (design). When I paste a bunch of text in (listfind) via this relationship I bring up all matching records in a portal. All good, it is very useful. However, I want to go a step further and add some kind of functionality wherein if there is a value on the list of items in (listfind) that I can indicate if anything in there does not match/makes the relationship invalid. Essentially a way to know if a value on the list is one that isn't there. Normally with a few it is no big deal but when I put in a lot of values it can be hard to tell what is and isn't there. 

 

I tried a script for highlighting text that philmodjunk posted about 6 years ago, but it doesn't seem to work and I'm not even sure it is what I need to do, for reference I have pasted it below:

 

Here's a looping script that does much the same thing: It places the styled text in a separate field so you can compare the original to the styled text, but a small change in the last line would make it apply the style to original field, though in that case you might want to add a step to apply textformatRemove to this field first if you don't want repeated runs of this script to leave text bolded by a previous run still in bold face.

Set Variable [ $I; Value:1 ]
Loop
       Set Variable [ $Word; Value:$Word + 1 ]
       If [ MiddleWords ( WordHighlighter::Paragraph ; $Word ; 1 ) = WordHighlighter::Word ]
               Set Variable [ $Paragraph;
                                 Value:$Paragraph & TextStyleAdd ( Middle ( WordHighlighter::Paragraph;
                                 $I ; Position ( WordHighlighter::Paragraph ; WordHighlighter::Word ; $I ; 1 ) + Length ( WordHighlighter::Word ) - $I + 1 ) ; Bold ) ]
       Else
               Set Variable [ $Paragraph; Value:Let ( word = MiddleWords ( WordHighlighter::Paragraph ; $Word ; 1 ) ; $Paragraph &
                                   Middle ( WordHighlighter::Paragraph; $I ; Position ( WordHighlighter::Paragraph ; word ; $I ; 1 ) + Length ( Word ) - $I + 1 ) ) ]
       End If
       Set Variable [ $I; Value:Let ( word = MiddleWords ( WordHighlighter::Paragraph ; $Word ; 1 ) ;
                           Position ( WordHighlighter::Paragraph ; Word ; $I ; 1 ) + Length ( Word ) ) + 1 ]
       Exit Loop If [ $Word ≥ WordCount ( WordHighlighter::Paragraph ) ]
End Loop
Set Field [ WordHighlighter::Paragraph 2; $Paragraph ]

 

 

Is this possible? Would it be possible through a calculation? Any help would be great!

Outcomes