1 2 Previous Next 15 Replies Latest reply on Apr 18, 2014 2:19 PM by philmodjunk

    How to Get value from most recent record

    B_1

      Title

      How to Get value from most recent record

      Post

           I am trying to pull the most recent field values from a certain layout the most recent time it was filled out. This way I can export the data to possibly Excel and then import it each time into a Dymo Printer. How would I manage to pull these most recent entered values into the new custom made Dymo_Stickers layout to be sent to an Excel File and saved every time a new record is completed.

        • 1. Re: How to Get value from most recent record
          philmodjunk

               You do know that you can print from FileMaker directly to a Dymo printer?

               The most recently created record will be the last record if it is in the current found set and it is unsorted. Thus you can show all records and navigate to the last record to access the most recently created record in a given layout's underlying table. This can be done manually or in a script.

          • 2. Re: How to Get value from most recent record
            B_1

                 No I did not know that. Thank you Phil, I'll look into setting up a script to print it directly to the Dymo. Is there a way to pull fields from say a range of records and print them in succession? 

            • 3. Re: How to Get value from most recent record
              philmodjunk

                   Yes. But if you want assistance in how to do that, you'll need to describe what you want to do in much more detail. Keep in mind that a Layout, a Table and a Tutorial: What are Table Occurrences? can and often do have exactly the same name in FileMaker, but they are not the same thing.

              • 4. Re: How to Get value from most recent record
                B_1

                     Ok, so I have a layout named TestInfo that has the information I need to be printed on labels. 

                     I am pretty sure my first step is to create a label layout or use a preset layout in FM (I looked up some old forum posts and saw one of your answers there applying to this a little bti). However, I do not believe the Dymo labels that I use are one of the presets. So I guess I will have to figure out how to make the Dymo layout first before any other progress can be made. Is that the correct first step in this process? Then, use scripts to pull the information onto the label layout and then print from there?

                      

                     I am using a label that has 4 small circle labels on it. I need to print the same thing on all 4 circles. It is a very simple thing that needs to be printed on there. For example a County Code, a Family Code, and a pool number. 

                     so it would look something like what is shown below :

                      

                     40M205

                • 5. Re: How to Get value from most recent record
                  philmodjunk

                       The presets are for avery type labels that arrange labels into multiple columns and rows on each page of labels. For "one label at a time" printers such as the Dymo, they should install with their own custom page sizes. You go to or create the layout that you want to use for printing the layout and use print set up to specify the custom page size appropriate for your set of labels. You then adjust the size of the layout to fit the heavy vertical and horizontal lines that then show the limits of this custom page size on your layout.

                       

                            I need to print the same thing on all 4 circles.

                       You'll probably need to create four records that all have the same info in any fields that you locate on this layout.

                  • 6. Re: How to Get value from most recent record
                    B_1

                         Ok, so I have the layout for the labels made and have it printing in the correct area of each of the 4 circles. I made each of the fields in each circle the same field so they will all print the same thing out. 

                         My plan is to set up a calculation to pull the info from the layout that the information will originally be entered in. 

                         This is where I run into problems as the original layout that the information will go into is a grandchild record (Test_Info). It has a f_key and a p_key. I am not sure how to relate them so that the calculation will work. 

                         Also, I may have 16 related records in Test_Info that all come from the child record (Trap_Info). I would want all 16 of the grandchild records to print out labels as well. 

                         Any suggestions on how to do these things?

                    • 7. Re: How to Get value from most recent record
                      philmodjunk

                           Why do you need a calculation to do this? Why can you not just print from a found set of records?

                           To repeat from my first post, a layout is not a table. You will not "pull data from a layout" as that data is stored in one or more records of a table. You will access the data in those tables.

                           But it is not at this time clear:

                           a) the exact structure of your tables and relationships used for your labels

                           b) exactly how you want to print that data out on the labels layout.

                      • 8. Re: How to Get value from most recent record
                        B_1

                             The reason I was thinking to make a new field on a new layout with a calculation in place is because what needs to be printed is a concatenation of 3 different fields from Test_Info

                             My relationships between the 3 tables Parent --> Child --> Grandchild will be attached in a picture below. 

                             Parent = Vector_CollectionSite

                             Child = Vector_TrapInfo

                             Grandchild = Vector_TestInfo

                              

                             I am not sure how to relate the label layout (Vector_Dymo_Stickers) to the other layouts. 

                             Sorry for the confusion on layout and table. I meant to pull the data from the Vector_TestInfo table. 

                              

                             And I would be more than happy to just print from a found set of records. But how would I get the information from said found set of records to print using the Vector_Dymo_Stickers.

                              

                             Sorry for any confusion on terms and knowledge in FileMaker, still fairly new to the whole program, and database creators in general. 

                        • 9. Re: How to Get value from most recent record
                          philmodjunk
                               

                                    what needs to be printed is a concatenation of 3 different fields from Test_Info

                               That may need a calculation field or it may be possible just to place all three fields together as <<mergeFields>> inside the same text object on your label layout. You can use Insert Merge Field from the Insert menu to add merge fields to your layout.

                               

                                    I am not sure how to relate the label layout (Vector_Dymo_Stickers) to the other layouts.

                               In layout setup | Show Records From, you select a table occurrence to set the "context" for your layout. A table occurrence is one of the boxes in your screen shot and refers directly to the records of one table. How that layout is related to other tables via relationships to other table occurrences controls how you can access data from them on your layout.

                               Every table occurrence has its own found set. Thus, every layout based on the same table occurrence shares the same found set as well as a "current record" and a "sort order" provided you stay within the same window. This means that if you find or create the record that contains the data you want to print on the label on one layout, you may need to do no more than change layouts and print the current record to print the data from that record.

                               In other cases, more may be needed to select the correct record or set of records. Go to related records, for example could be used to pull up a found set of all related child or grand child records from a layout based on the parent table.

                               Does all the data that will print on a single label come from Vector_TestInfo? Or does some data come from Vector_TrapInfo and/or Vector_CollectionSite?

                          • 10. Re: How to Get value from most recent record
                            B_1

                                 All of the data is on Vector_TestInfo

                            • 11. Re: How to Get value from most recent record
                              B_1

                                   I could technically pull the data from one field (SpecNumber_Truncated) in Vector_TestInfo, but I will first need to set up the field on the Vector_Dymo_Stickers layout to cut off the last 5 digits from SpecNumber_Truncated

                              • 12. Re: How to Get value from most recent record
                                philmodjunk
                                     

                                          but I will first need to set up the field on the Vector_Dymo_Stickers layout to cut off the last 5 digits from SpecNumber_Truncated

                                     That would require a calculation field defined in Vector_TestInfo and if that is the only data on the layout, you'd need to base your label printing layout on Vector_TestInfo.

                                • 13. Re: How to Get value from most recent record
                                  B_1

                                       I got it to work and I must say it is much easier than I expected. Thank you for all of your help on this matter Phil. I really appreciate it. I figured I would still be working on this tomorrow. Now I am going to make a button and place it on Vector_TestInfo and have it set with a script to print off the found record set from the Vector_Dymo_Stickers

                                  • 14. Re: How to Get value from most recent record
                                    B_1

                                         These labels are printing perfectly with the script I have created. 

                                         My question is, what happens when my co-worker wants to use this button with script function to print labels on his computer with a different Dymo. Would we need to name our Dymo's exactly the same so that the script would work for either printer. 

                                         Or.. should I write a If, Else script, in which the two printers are the If and Else situations. 

                                          

                                    1 2 Previous Next