9 Replies Latest reply on Sep 1, 2016 9:12 AM by BruceRobertson

    Cannot display data on Portal

    dig

      Hello Everyone – I am seeking some guidance.

       

      I am doing something wrong and have attempted to resolve by trying many different variants to attempt to get “Plant” assigned to a customer to show up on the customer via a portal. I have also failed to show all Contacts for a company to show up under a portal.

       

      My Aim is to be able to use tabbed interfaces with Portals so information can be viewed such as contacts for that company, or plant assigned to that company, or how many job sites that company has.

       

      I have been able to show a company that a Contact is related to on the Contacts Layout.

       

      I have read and searched for an answer and now feel I must be doing something very basic wrong, I do struggle with relationships; although I thought I had it.

       

      Would someone please help me understand where I am going wrong with the attached solution as I feel I am close and there must be something basic I am doing wrong.

       

      Thank you

       

      Troy

       

      ERD.JPG

        • 1. Re: Cannot display data on Portal
          BruceRobertson

          Well, one thing you're doing wrong is creating text primary keys (IDs) and declaring the field type to be Number.

           

          Example: _kp_CONTACTS_ID

          Next ID:

          XCXK00000000000012

          1 of 1 people found this helpful
          • 2. Re: Cannot display data on Portal
            dig

            Thank you Bruce, I have made the changes.

            • 3. Re: Cannot display data on Portal
              dig

              I have added the updated file

              • 4. Re: Cannot display data on Portal
                BruceRobertson

                And what is the purpose of adding the new file?

                What question do you still have?

                I notice that the foreign key fields ( example, CONTACTS _kf_CUSTOMER_ID ) are still number fields.

                So it is still not going to work.

                And suppliers, _kf_CONTACT_ID, is not only still a number field, but it is auto-entering a value, as if it was a primary key.

                1 of 1 people found this helpful
                • 5. Re: Cannot display data on Portal
                  dig

                  Hi Bruce - Thank you, you have taught me keep a keen eye.

                   

                  The reason I have attached (& again just now also) my file is in the hope that someone will show me the error I have made. I am certainly not asking anyone to complete this project, instead just show me why it is not working and how it should work.

                   

                  I will keep at it until I get this working, however the more I watch training videos on Udemy the more I don't understand why my relationships are not working.

                   

                  As I mentioned above, I do not know if my ERD is OK or not. I don't know what to touch or not. It is a little frustrating as I feel I could go in circles for days.

                   

                  I feel like you are trying to tell me it is because of my field type choices, although even once fixed up I still have no change.

                   

                  Interestingly in all the videos I have watched, none of them have said not to use auto-entering values for foreign keys and if you use alphanumeric values do not choose a number type field, so thanks for setting me straight there!

                   

                  I thank you for making the time to guide and advise me Bruce, I certainly enjoy FileMaker and the journey of learning.

                   

                  I will add updates as I progress.

                   

                  Thanks

                   

                  Troy.

                  • 6. Re: Cannot display data on Portal
                    CarlSchwarz

                    I opened your file and I couldn't see a way to assign a plant to a customer.  Because you are using a JOIN table they will need to be assigned to each other via a script that will create a new join table entry with the customer id, and the plant id.

                     

                    Rather than try to do something with your file I thought I would just pass on one example of a working JOIN relationship, if you follow this pattern then it will work.

                     

                    The file has:

                    - One customer id = 100

                    - Two plants id = 1 & 2

                    - It has 2 join records to join the customer to the 2 plants

                    First join: customer id = 100 to relate it to the customer, plant id = 1 to relate it to the first plant

                    Second join: Customer id = 100 to relate it to the customer, plant id = 2 to relate it to the second plant.

                     

                    Play around with creating customers and plant and creating join tables to join them together.  Once you have worked that out then you can see how to replicate what you are doing manually when you create a join, and can write a script that will create the join entry to join them together.

                    2 of 2 people found this helpful
                    • 7. Re: Cannot display data on Portal
                      dig

                      Hi Carl - thanks very much for the example, it really hit it home for me. I will keep it as a reference as I progress.

                       

                      Thank you.

                       

                      Can I ask another question off this example you provided, How can I ensure that the plant is only assigned to one customer at a time. I am able to assign the plant to two customers at once in this example file.

                       

                      If you could provide a term or a reference link for me to read that would be great.

                       

                      Thanks again for your assistance.

                       

                      Troy

                      • 8. Re: Cannot display data on Portal
                        CarlSchwarz

                        Because you are the one that is manually creating a join between the Customer and the Plant then it is up to you to ensure that you don't connect a Plant to more than one Customer.

                         

                        You could double check that you don't create more than one join record for a Plant in your create join script, or handle it in your user interface somewhere so that it is not possible for a user to do it.

                        1 of 1 people found this helpful
                        • 9. Re: Cannot display data on Portal
                          BruceRobertson

                          "I feel like you are trying to tell me it is because of my field type choices, although even once fixed up I still have no change."

                           

                          I doubt that field types are the whole problem. But it is a minimum and obvious thing to get straightened out.