I assume that you are using this function call in a calculation field. The following should work:
HiliteSingle ( address_description ; Contacts::street1 )
Make sure that you select "Evaluate from the context of Addresses_Contacts||dove_account||" in the "context" menu at the top of specify calculation.
Its getting there, but it is only Highlighting portal row serched from the first Contact Record. The first Record in Contacts has Street1 as 2141 W. Gate Place and that is Highlighted in every Contacts Record in the Portal.
I get confused when I re-examine your original post.
You indicated that you have this relationship:
Contacts::dove_account = Addresses::dove_account
but that your portal refers to:
Which is not listed in your relationship.
Is your relationship really this?
Addresses::dove_account = Addresses_Contacts||dove_account||::dove_account
Is the layout on which the portal is located based on the occurrence of Addresses used in the above relationship?
Your reference to Contacts::street1 highlighting text in Addresses_Contacts||dove_account||::address_description
doesn't make sense here as there is no relationship specified betweeen two occurrences of contacts.
My appologied Phil,
The relationship is Contacts::dove_account = Addresses_Contacts||dove_account||::doveAccount
The portal is on Contacts.
Showing records from Addresses_Contacts||dove_account||
The field on the portal is
address_description is a calculation
HiliteSingle ( Addresses_Contact||dove_account||::address_description ; Contacts::Street1 )
Addresses_Contacts||dove_account|| is an occurrence of Addresses
Address_description refers to itself in it's calculation making this a recursive calculation that then evaluates recursively with no end condition to stop the recursion.
It looks like you need two fields where you have one: Address_Description--a text field containing the address_description text or a text function that combines data to produce the text shown in it, and Highlighted_Address_Description that uses your custom function to refer to the search text and the text in Address_Description.
That said, this calculation would be defined in Addresses and defined to evaluate from the context of Addresses_Contacts||dove_account||
Which would define Highlighted_Address_Description as:
HiliteSingle ( address_Description ; Contacts::Street1 )
I have done like you suggested and its still doing the same thing.
I created an auto field to Index the address_description address_description2
then I created another field Highlight_address_description Type:Calculation, From Addresses_Contacts||dove_account||, = HiliteSingle (address_description2 ; Contacts::Street1 )
I've been playing with a demo file figuring to share it with you and think I have spotted the problem.
This is a self join relationship, so if you have 4 or 5 records with the same value in dove_account, any one of them could be the current record when you examine the list of records in the portal, but when you refer to field from a related table, such as your street 1 field, all the records will refer back to the first related record and thus this funciton highlights according to the text in the Streat1 field regardless of which record is current.
To get the results you want will take some changes.
The simplest is to use a field with global storage in place of street1, but I am guessing you want the text to highlight by the current text in street1 without the user needing to enter or edit the text in that field and that this text should be different on every record.
Use this expression instead of the current call:
HiliteSingle ( address_Description ; $$Street )
Then use the onRecordLoad script trigger to perform this script:
Set Variable [$$Street ; value: Contacts::Street1]
If you don't see things highlight correctly, add a refresh window step after the set field step.
This assumes that you are browsing these records on a form view layout.
That works great... Thanks Phil.