Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Quick question on finds in a portal


ibiubu

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

Recommended Posts

In my main database I have a portal. If I go to a particular record there are 30 line items in the portal. If I do a find, for example, to only show the ones where a field = yes, I still get all 30 items (there are only 5 the field = yes).

I could do a layout where the portal is based off a relationship where I have a global field in the main file and the =yes field in the related file. Then when I choose yes in the global field only the records where field = yes are displayed.

Could this somehow work in some way like above, but maybe I would have 4 global fields. Depending what the user selects in the 4 fields, would then create the relationship thus showing only the appropriate portal records.

LR

Link to comment
Share on other sites

In a sense a portal is already displaying the results of a 'find' - it is 'finding' all the related records. You cannot do a further find in a portal in the way you were originally hoping, as that would cut across the integrity of the portal as a relationship 'window'.

Instead, the technique you are thinking of, where the portal relationship is based on a calculated key - which includes one or more global fields, is a viable alternative. In fact this is the basis of what is often referred to as 'portal filtering'.

Link to comment
Share on other sites

That is what I thought the answer would be. I understand how I can have one global field that, once set, fills in the first part of the relationship.

Is there a way to have 2 global fields. Choose one criteria in one field, choose another criteria in the second field, and then have the portal records that match both criteria be displayed.

I know how to do it with one global field, but not two or more.

LR

Link to comment
Share on other sites

Hi LR,

In a sense it's really just an extension of the same general principle, but when there are two or more criterion in the mix, you have to decide whether you want an 'OR' logic for the filtering, or an 'AND' logic.

The AND method:

If you have two different criteria fields, they will be referring to two different values in order to have an 'AND' logic applied. In that case, you need a calculating key field in the related file which concatenates the two fields that the criteria will match to, and a calc key in your main file that concatenates the two global criteria fields.

Thus when a pair of values is selected in the global criteria fields, a 'pair match' key is created (behind the scenes) in the calc key in the main file, and any records which have corresponding contents in field 1 AND field 2 will be matched and displayed in the portal.

The key field formula in this case is: gCriteria1 & gCriteria2

The OR method

In it's most common implementation, filtering which is to have an 'OR logic' applied is targetting a single field in the related file, but it can target more than one field if desired. For more than one field to be targetted using an OR paradigm, you need a calculating key field in the related file which appends the two fields, separated by a carriage return, and a corresponding calc key in your main file, that brings together both fields, separated by a carriage return.

In this case, the cacl result type of both key fields must be text, regardless of the data type of the original fields.

The main field calc key formula in this case is: gCriteria1 & "

Link to comment
Share on other sites

This topic is 7988 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.