14 Replies Latest reply on May 24, 2009 8:55 PM by comment_1

    FM BUG!!???!!!   I am really frustrated by this one!!!! Plz help...

    synergy46

      Title

      FM BUG!!???!!!   I am really frustrated by this one!!!! Plz help...

      Post

      The above is a simplification of the real application but it does show the problem.  (Yes, "Allow creation of records" is turned on in the 'many' toc)

       

      Layout is based on Customers.

      Portal is based on Transactions

       

      The first field of the portal is CustomerID.fk which is a popup based on a Value List:  Customers::CustomerID.pk and Customers::CustomerLast.

       

      When I click the CustomerID.fk popup, it pops up all the names as expected.  When I select the name it acts a little weird in usually selecting some other name than the one I want.  I usually have to make a second selection to get the one I want.  I can do this in succesive rows without a problem.

       

      However, if, when finished, I click outside the portal, all the portal rows with entered data are deleted.  Poof!!!!

       

      I have opened a 2nd window and put Customers in it and watched as I made selections.  The Customers record pointer does not move????  Does that have something to do with it?

       

      Anyway, I have read several books and and gotten confirmation on the forum that I am doing it correctly but it DOES NOT WORK!!!???   So.... is this a bug?????  (because of it's problem's obvious nature I conclude that I am doing something wrong but can't see what it is!!!  Can you help?

        • 1. Re: FM BUG!!???!!!   I am really frustrated by this one!!!! Plz help...
          comment_1
            

          There is no bug here, and you are NOT doing this correctly.

           

          The idea behind "Allow creation of records…" is that you can enter data into a portal, and a new child record will be created and automatically assigned to the current parent record. You do not need to enter anything in the CustomerID.fk field - in fact, you don't need even to see it. Filemaker populates this field for you with the value taken from the CustomerID.pk field in the current customer record.

           

          Changing the value in CustomerID.fk to another customer's id has the effect of breaking the link to the currently viewed customer, and assigning the transaction to another customer. The record is not deleted - it has simply moved.

          • 2. Re: FM BUG!!???!!!   I am really frustrated by this one!!!! Plz help...
            synergy46
              

            Thank you for the reply.

             

            Your explanation was clear but I still confused about why the  CustomerID.fk popup is not being updated with the CustomerID.pk in Customers???

             

             

            Also, even when I take Transactions::CustomerID.fk OUT of the portal it still does not reflect the associated (but not linked) Customers::CustomerID.pk.  Isn't it supposed to do that?

             

             

             

            • 3. Re: FM BUG!!???!!!   I am really frustrated by this one!!!! Plz help...
              comment_1
                

              If there is a transaction record in the portal, then it's CustomerID.fk must be the same as the current customer's CustomerID.pk - otherwise it wouldn't be in the portal.

               

              If you see something else, perhaps there's something wrong with with your value list - try changing the field to edit box, or open a new window to Transactions and observe the CustomerID.fk value there.

               

              Also make sure the field in the portal comes from the correct occurrence of the table.

               

               

              EDIT:

              I have only now seen the image, but I cannot see anything wrong with it.

              • 4. Re: FM BUG!!???!!!   I am really frustrated by this one!!!! Plz help...
                synergy46
                  

                You can't see anything wrong with the diagram because the problem lies with the developer; me.  :smileyvery-happy:

                 

                I think I 'get' what you are saying; ie, the layout is the customer.pk and the portal is related to that single record.

                 

                Each layout 'new record' is for a new customer and the resulting portal is for just that customer.  Great.  I got that working.

                 

                Question: "Do you know of any way to put a popup containing customers above the portal and have it serve as a way to navigate to a specific customer?"   My immediate thinking is to create a global field and make it the popup into Customers.  Then take the value of that field and do a 'find' in Customers.   However, when I open a separate window and put Customers in it and then manually select a new record, the Transactions table DOES NOT reflect the change.   How can I get Transactions to move in conceret with Customers???

                 

                Thanks again....

                • 5. Re: FM BUG!!???!!!   I am really frustrated by this one!!!! Plz help...
                  comment_1
                    

                  I am not sure what you mean here:

                   


                  synergy46 wrote:

                  when I open a separate window and put Customers in it and then manually select a new record, the Transactions table DOES NOT reflect the change.


                  The Transactions table doesn't know nor care about navigation that happens in a layout of Customers. That's why you have the portal - when you navigate to a customer's record, the portal shows the transactions assigned to that customer. Think of it as a "mini-find": you select a customer's record, and the record asks the Transactions table to find the related transactions and "send" them to the portal.

                   

                  If you want, you could put a customer's ID into a global field, and define another relationship matching the global with the CustomerID in the Transactions table (you will need to use a new occurrence of Transactions for this). Then every time you select a customer in the global, the portal (to the new occurrence of Transactions) will show the selected customer's transactions.

                   


                  • 6. Re: FM BUG!!???!!!   I am really frustrated by this one!!!! Plz help...
                    synergy46
                      

                    Thanks for the idea.

                     

                    You said: 

                    If you want, you could put a customer's ID into a global field, and define another relationship matching the global with the CustomerID in the Transactions table (you will need to use a new occurrence of Transactions for this). Then every time you select a customer in the global, the portal (to the new occurrence of Transactions) will show the selected customer's transactions.

                     

                     

                    I tried the above but it did nothing.  Is this what you meant?

                     

                    • 7. Re: FM BUG!!???!!!   I am really frustrated by this one!!!! Plz help...
                      comment_1
                         Yes. Now if you select a customer's ID in the global field, a portal to Transactions 2 will show their transactions (no matter which record you are on in Customers).
                      • 8. Re: FM BUG!!???!!!   I am really frustrated by this one!!!! Plz help...
                        synergy46
                          

                        Hmmm... I changed the portal to transactions 2 and that made each row of the portal the same for each customer.

                         

                        And, I didn't have the ability to input into any row and the g.customerID (which is linked to a value list of customerID.pk and CustomerLast)... does nothing; the same as if the portal was left on Transactions ???

                         

                         

                         

                        • 9. Re: FM BUG!!???!!!   I am really frustrated by this one!!!! Plz help...
                          comment_1
                             It looks like the fields in the portal are from the Transactions occurrence, instead of Transactions 2.
                          • 10. Re: FM BUG!!???!!!   I am really frustrated by this one!!!! Plz help...
                            synergy46
                              

                            Sharp eye!  Thanks. 

                             

                            The g.customerID popup moves to the correct record as you said it would. 

                             

                            However:  I can not input any records in the portal row of Transactions2 and b) the Customer::CustomerLast merge field at the top of the layout (Currently says LU) stays the same.   

                             

                            Isn' there some way to do the same thing but use Transactions instead of Transactions2?????

                            • 11. Re: FM BUG!!???!!!   I am really frustrated by this one!!!! Plz help...
                              comment_1
                                

                              synergy46 wrote:

                              The g.customerID popup moves to the correct record


                              No, that's not what happens. You are standing still in the Customers table. All it does is fetch a new related set into the portal every time you change the global ID value. That's also why the customer's name stays the same. If you want to see the customer's name change, you need to define another relationship as:

                               

                              Customers::gCustomerID = Customers 2::CustomerID.pk

                               

                              and place the name field/s from Customers 2 on the layout.

                               

                               


                              synergy46 wrote:

                              I can not input any records in the portal row of Transactions2


                              Have you enabled record creation for Transactions 2, in the relationship definition?

                               

                               


                              synergy46 wrote:

                              Isn' there some way to do the same thing but use Transactions instead of Transactions2?????


                               

                               Yes, but it will be a two-step process. Define the self-join relationship described above, and create a script that does:

                               

                              Go to Related Record [ from Customers 2 ; using current layout ]

                               

                              Now you can (1) select the ID in the global field; (2) call the script to move to the selected customer's record.

                              If you're using version 10, you can attach a script trigger to the global to have it run the script OnObjectModify.

                               




                              • 12. Re: FM BUG!!???!!!   I am really frustrated by this one!!!! Plz help...
                                synergy46
                                  

                                Wow. That works like the proverbial charm.   Now I will have to study the layout and figure out the why.

                                 

                                Thank you very much .

                                • 13. Re: FM BUG!!???!!!   I am really frustrated by this one!!!! Plz help...
                                  synergy46
                                    

                                  Your solution still works like a charm and is a very good 'learning' example for me. 

                                   

                                  But, I have these few, little questions:

                                   

                                   

                                  This is how I set things up.  

                                   

                                  These are the Transactions...

                                   

                                  these are the Customers

                                   

                                  This is the Transactionn Layout for Lukey Lu... Again, using the above popup works great.  I just need to 'upgrade' my understanding of what is going on. 

                                   

                                  Question:  When I click the 'next record' and 'previous record' icons in the toolbar, nothing happens.  I suspect this is because the Layout is Customers and that record pointer is not being moved?  But, when we move the record pointer in Customers2 via g.customerID and since Customers2 is a duplicate of Customers shouldn't Customers be on the same record as Customers2?   Ah, but perhaps it isn't being moved because there is no relationship between Customer::CustomerID.pk and Customers2::CustomerID.pk????

                                   

                                  Also, what confuses me about all this is the apparent fact that Transactions and Transactions2 stay in sync as records are added and deleted...  But, Customers and Customers2 does not????

                                   

                                  Thanks again...

                                   

                                  • 14. Re: FM BUG!!???!!!   I am really frustrated by this one!!!! Plz help...
                                    comment_1
                                      

                                    synergy46 wrote:
                                    When I click the 'next record' and 'previous record' icons in the toolbar, nothing happens.  I suspect this is because the Layout is Customers and that record pointer is not being moved?

                                    Not exactly. The truth is that you DO move from record to record - but you have nothing on the layout that would change as the result of the move: the global has the same value for all records, and the portal won't change until the global is changed.

                                     

                                     


                                    synergy46 wrote:
                                    But, when we move the record pointer in Customers2 via g.customerID

                                    That's not a good way to look at it. Changing the value in the global field does NOT "move" anything. Perhaps it would help if you think of this as the difference between going to visit a place or calling them on the phone. The global field is merely the number you dial.

                                     

                                     


                                    synergy46 wrote:

                                    the apparent fact that Transactions and Transactions2 stay in sync as records are added and deleted...  But, Customers and Customers2 does not????


                                    There is only one table of transactions, and one set of data. So Transactions and Transactions2 do not "stay in sync" - they both look at the same base table for the data. The same is true for Customers and Customers2 - or at least should be, if Customers2 is an occurrence of the Customers table (hopefully you didn't create a new table for it?).