Jump to content
Sign in to follow this  
stefangs

relationship too complicated for me

Recommended Posts

for a table with not very many records, i have a portal on a layout that contains the main text field from all records using a selfjoin relationship with a constant as a match field. now all records show up nicely in the portal. each row is clickable to take me to the proper record. this lets me quickly move among records without leaving the details view. so far so good.

now i want to highlite certain text fields in the portal based on context. for example, the text data in the main field for some records might be might be red, green, blue, and for some others table, chair, lamp.

if i click either of the portal rows that say red, green, or blue, i want the related color fields to be highlighted. if i click either of the portal rows that say table, chair, or lamp, i want the other furniture records highlighted.

what i tried so far got me stuck. perhaps you already know what to do. for what it's worth, this is what i tried: to tell the records which group they belong, i created a field called related_records and fill that manually with return delimited info. for example, in the record called red, i write green and blue into the field. the other fields contain similar data for the other records while the table record would have chair and lamp filled in, etc. i then built a relationship from this field to the main text field to see if there is a match and if so, use a text formatting function to change the color as a highlight. this method didn't get me anywhere, i always get the same portal rows highlighted, no matter which records are active. any ideas on how to do it right? thanks in advance for any help.

Share this post


Link to post
Share on other sites

If you want records to highlight according to where you clicked, you must make the clicked record special. Being the current record is not enough - relationships keep working for all records, current or not.

Make the click enter the record's ID into a global field, and define an additional relationship matching the global to the ID. Then you can make the highlight true if category matches the selected record's category.

BTW, matching on constant became obsolete with version 7. Use the x relational operator instead.

Share this post


Link to post
Share on other sites

that's not quite what i meant. only highlighting one record in the portal isn't too hard. but i want several other records highlighted also which belong to what i consider related data, so that they stand out from the list in the portal.

perhaps it seems weird to try that, but in my case there are not very many records the data in them never changes, it's only for looking up stuff. highlighting related records that way would make navigation easier.

perhaps my example wasn't too clear - let me try again.

say the main text field in three records are called chevy, dodge, and subaru. so in the portal list these three items show up on individual rows. when i click on chevy, i want those three portal records highlighted, because they're all cars, while other records which contain other data, like maybe accesories would not be highlighted.

my idea was to create a text field which contains text data from the related records. in the case of the record called chevy, this field would contain dodge and subaru.

thanks for the heads up on matching on constants - i missed that!

Share this post


Link to post
Share on other sites

well, you can easily expand on the technique by putting more than one value in the global text field. Then the record in the portal looks to see if it "matches" any value in the global, and if so, highlights.

Share this post


Link to post
Share on other sites

ah yes sorry. looks like i didn't understand you correctly the first time. i got it now. sorry about that.

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×

Important Information

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