6 Replies Latest reply on Jun 20, 2015 9:14 AM by philmodjunk

    How to hide records from the List in a match field?

    starstuff

      Title

      How to hide records from the List in a match field?

      Post

      Hi All,

       

      i was able to filter records using a match field.

      Table - Companies

      Companies_Supplier TO

       

      Fields

      pk_companies_id = primary key

      companytype = value list = supplier , customer

      c_supplier_only = calculation "Supplier"

       

      Relationship

      Companies::pk_companies_id = Companies_Supplier::pk_companies_id AND

      Companies::companytype = Companies_Supplier::c_supplier_only

       

      when im viewing the company_supplier table , i would like to view the suppliers only, without any "blank" records
       

      whats happening is that the records are showing all the companies, the suppliers are listed, you can read them while the customer are all "blank"

       

      how to remove/hide these blank records?

       

      Thank You!

       

        • 1. Re: How to hide records from the List in a match field?
          philmodjunk

          In what context? Is this in a portal? Or do you have a layout based on Company_Supplier used to show these records? Or in a value list?

          Your relationship is set up to enable you to see records in Companies that are Suppliers when viewed/accessed from the context of Companies_Supplier. Given the table name here, It's not clear why a table named "Company_Supplier" would have records for any company that is not a supplier. So please explain your basic design.

          • 2. Re: How to hide records from the List in a match field?
            starstuff

            Hi PhilModJunk!

            Im viewing the data in Browse Mode - Table and Form Views, i used these layout based on Table Company_Supplier to view records.

            See the attachment below for the "blank" records im seeing in the Table View.

            • 3. Re: How to hide records from the List in a match field?
              starstuff

              Hi PhilModJunk!

              Company_Supplier is a TO of Table Company

              Table Company contains all the companies, supplier and customer, i do this because sometime a supplier is also a customer.

               

              Fields Match

              companytype = a value list = choose either or both  supplier , customer

              c_supplier = calculation "Supplier"

              c_customer = calculation "Customer"

               

              Thank You!

              • 4. Re: How to hide records from the List in a match field?
                philmodjunk

                Those really aren't blank records.

                Your layout is based on Companies_Supplier and the column shown if from Companies. The "blank records" are simply records in Companies_Supplier that do not match to any record in Companies. (The fact that both of these occurrences share the same base table makes no difference.)

                This is not how to use a relationship to control what records are visible/accessible. You could use Go To Related records from a layout based on Companies to go to a layout based on companies_supplier and the resulting found set would only be those companies that are suppliers.

                You could also perform a find for all records with "supplier" in the company_type field and not use any relationship at all.

                If you had a relationship like this:

                Companies_Supplier::c_Supplier = Companies::Company_Type

                A portal to companies would list all suppliers.

                • 5. Re: How to hide records from the List in a match field?
                  starstuff

                  the goal is to separate the suppliers from the customers inside the COMPANIES table,

                   

                  i will test out the go to related records and find, im a bit hesitant to use it because i have to deal with scripts.

                   

                  thanks for the help!  i was able to make the portal work by removing the primary key fields removed

                   

                  instead of using this

                  Companies::pk_companies_id = Companies_Supplier::pk_companies_id AND

                  Companies::companytype = Companies_Supplier::c_supplier

                   

                  i only use this

                  Companies_Supplier::c_Supplier = Companies::Company_Type

                   

                  and i got the result im after.

                   

                  can you explain the difference between the two set of matches?

                  i added the pk_companies_id to the match because i want it to match the same id of the table.

                   

                  Thank you again!

                  • 6. Re: How to hide records from the List in a match field?
                    philmodjunk

                    With the ID fields included as match fields, you have a one to one relationship. It either matches to just the one company record (the same record, but via the second table occurrence) IF the company is a supplier or it does not match to any company, if the company is NOT a supplier.

                    By using just the calculation field and company type fields, you match to multiple records in the table, all records where company type = the value returned by the calculation field.