13 Replies Latest reply on Aug 23, 2016 10:36 PM by philmodjunk

    Get Data from Last Record

    JavedulHaq

      Title

      Get Data from Last Record

      Post

           Hi, In my db some fields are set  to get data from last record. Although it works fine but some times it does not copy data from last record, that is astonishing for me. Then i have to write data again in those fields. What may be wrong or it is a bug in fm 12 pro ad.

        • 1. Re: Get Data from Last Record
          philmodjunk

               Last record in the layout's table? The Layout's Found set or the Last record in a set of related records such as you might display in a portal?

          • 2. Re: Get Data from Last Record
            JavedulHaq
            /files/9533430a26/Project1.jpg 1280x691
            • 3. Re: Get Data from Last Record
              philmodjunk

                   And what exact method are you currently using to copy the data?

              • 4. Re: Get Data from Last Record
                JavedulHaq

                     When ever i click on "Create New Record" the said values should appear. If there is any other perfect method, Plz tell me.

                • 5. Re: Get Data from Last Record
                  philmodjunk

                       It depends on what you want. The option that you are using does not copy data from the previous record in your table, it copies data from the "last visited" record. If you edit data in the 2nd record in your table and then create a new record, the 2nd record was your "last visited" and the auto-enter options you've specified copy data from the 2nd record instead of the last record.

                  • 6. Re: Get Data from Last Record
                    JavedulHaq

                         Ya same thing is happening to me, but i want to get rid of this. How ? could not find. Can you suggest me to do it correctly?

                    • 7. Re: Get Data from Last Record
                      philmodjunk

                           To repeat: It depends on what you want.

                           What's your definition of the "last record"?

                           It looks like you want to always copy from the record that was created immediately previous to the new record you have just created, but I'm guessing. Is that what you want?

                      • 8. Re: Get Data from Last Record
                        JavedulHaq

                        When ever i click on "Create New Record" the said values should appear on every new record either it is by copying or any thing else, the main thing is that new record should not be empty. Actually i want these fields change able. I mean when ever i wish to change them. And after changing, the new values should appear on every new rec. 

                        • 9. Re: Get Data from Last Record
                          philmodjunk

                               That doesn't answer my question. Yes, I understand that you want all of these values automatically copied into the new record and that you want them to be editable. But from what record in your table should they be copied?

                               Will this always be the oldest record preceding the one you just created or are there other factors involved that determine what record is the "last record"?

                          • 10. Re: Get Data from Last Record
                            JavedulHaq

                            This will always be the oldest record preceding, the one i just created and  there are no other factors involved that determine what record is the "last record. For example i created id 42, This is my last record. Now i create new id43, values should come from id 42.

                            • 11. Re: Get Data from Last Record
                              philmodjunk

                                   id is exactly the field that I was about to recommend that you create if you didn't already have it. This should be a field of type number that auto-enters a serial number in order for the following to work:

                                   Go to Manage | Database | Relationships and use the duplicate button (two green plus signs) to make a new Tutorial: What are Table Occurrences? of SaleTrike. Link it in a relationship like this:

                                   SaleTrike::id > SaleTrike 2::id

                                   Double click the relationship line to get a dialog box where you can change the = to >. With that dialog box still open, click the Sort button for SaleTrike 2 and set it up to sort records by id in descending order. This will make the oldest previous record the first related record in this relationship.

                                   Now click over to Fields and change the auto-enter field options for your fields where you want to copy over this data to use the looked up value option to copy over data from the same field from SaleTrike 2.

                              • 12. Re: Get Data from Last Record
                                rz500

                                Sorry to doit hère, but I cannot find, I´m to rusty in File Maker, I stop using it since 7, an now everything change, I need help, with an inventory file, I have the numeric fields of Quantity, Sales, Buy, and Stock after all ( this last one is a calculation from the last 3, and I need when I create a new record to copy the number from Stock field and put it in Quantity in my new record.

                                 

                                Any Help?

                                 

                                Remember the new file maker change a lot, and I´m still in FM 12

                                 

                                Kind regards

                                • 13. Re: Get Data from Last Record
                                  philmodjunk

                                  The method that I described two years ago still works in the latest version.