Have you tried using Filter in the portal options?
And the way you test for not empty is: not IsEmpty( yourField )
Thank you Fitch,
I was excited for the solution but I'm stuck here :
If ( not IsEmpty ( Materiel::Rentré le ) ; resultOne ; resultTwo )
I'm just a beginner, please be patient.
not IsEmpty ( Materiel::Rentré le )
There is no need for the If function. Though some people choose to use:
If ( not IsEmpty ( Materiel::Rentré le ) ; 1 ; 0 )
That actually just repeats the values returned by the first option.
In other words, we're just testing whether [not IsEmpty()] is true or false. FileMaker recognizes 0 as false, and any non-zero number (e.g., 1) as true.
In a portal filter, related records that return a true result will display, and false will be hidden.
Keep in mind, this only affects the interface. If you use a calculation like Count(related::field), the result will respect the underlying relationship and ignore the portal filter.
Thank you guys, your answer works but I realised a redundancy problem. Let me explain what I need to see:
Got an invoice layout with
- a portal
- an IDfield (text).
If I write the item id# in the field outside the portal, the item appears in the portal, great.
But, once I create a new invoice and I type the same id# of the preview invoice sheet, I see the same item appearing in the portal row.
I don't want to see the same item listed again. Because the item I talk about is, let's say, rented out.
Once the item is available again from the renting person #1, then it can appear again in the second sheet. It can be rented by a second person.
Hope I made it not too confusing.
That is very confusing.
You need to describe your relationship including what match fields are used.
Then explain why you are typing into an ID# field outside the portal in the first place.
Thank you Phil,
the easiest way to explain is by images, here the snapshot of the relationship
Here it is the layout of the invoice called in french "Commande"
Here it is the final result
"Then explain why you are typing into an ID# field outside the portal in the first place."
Because is the only simple way without scripts I've found to populate a portal as I needed.
Thank you in advance,
I see a layout based on "lineitems" which is unexpected here for an "invoice" layout. I see a portal on that layout but cannot tell on which table occurrence in your relationships graph it is based. I don't see any table occurrence that would support the use of a portal on a layout based on LineItems as LineItems has "many to one" relationships to the two related table occurrences shown in your graph.
So on what table occurrence is that portal based and how does it link to line items?
If it's material, it's by a different relationship shown or there would only be one record or no records visible in the portal. Multiple records would not be possible given the indicators shown in the relationship graph. (And linking a "line item" to multiple material records doesn't make sense either.)
And that does not match your other screen shot that shows multiple records in the portal.
Your relationship clearly shows one Material record matching to many line items. In order for your portal to list multiple records as is shown, you'd need one Line Item Record to match to many Material records and that is not shown as possible in your relationship graph judging by the "crows feet" connectors on the Line Items side of the relationship.
So this just doesn't add up.