11 Replies Latest reply on Aug 11, 2017 11:16 AM by philmodjunk

    if field not empty don't show portal row

    glupoi

      Hi,

      I'd like to tell my portal not to show the row in which the fields date isn't empty.

      In other words, if the date field in the portal row is not empty, do not show the row.

       

      Thank you in advance,

      Giuseppe

        • 1. Re: if field not empty don't show portal row
          fitch

          Have you tried using Filter in the portal options?

          • 2. Re: if field not empty don't show portal row
            fitch

            And the way you test for not empty is: not IsEmpty( yourField )

            • 3. Re: if field not empty don't show portal row
              glupoi

              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.

               

              Thank you,

              Giuseppe

              • 4. Re: if field not empty don't show portal row
                philmodjunk

                Just use:

                 

                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.

                • 5. Re: if field not empty don't show portal row
                  fitch

                  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.

                  • 6. Re: if field not empty don't show portal row
                    glupoi

                    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.

                     

                    Thanks,

                    Giuseppe

                    • 7. Re: if field not empty don't show portal row
                      philmodjunk

                      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.

                      • 8. Re: if field not empty don't show portal row
                        glupoi

                        Thank you Phil,

                        the easiest way to explain is by images, here the snapshot of the relationship

                        Screen Shot 2017-08-11 at 12.35.05.png

                        Here it is the layout of the invoice called in french "Commande"

                        Screen Shot 2017-08-11 at 12.37.22.png

                         

                        Here it is the final result

                        Screen Shot 2017-08-11 at 12.37.33.png

                         

                        "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,

                        Giuseppe

                        • 9. Re: if field not empty don't show portal row
                          philmodjunk

                          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.)

                          • 10. Re: if field not empty don't show portal row
                            glupoi

                            philmodjunk wrote:

                             

                            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

                            It is based on Materiel table

                            Screen Shot 2017-08-11 at 19.54.07.png

                            • 11. Re: if field not empty don't show portal row
                              philmodjunk

                              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.