5 Replies Latest reply on Jan 13, 2017 6:39 AM by Mike_Mitchell

    Selective record printing


      Hi everyone,


      I would like to know whether I can print records on a selective basis only once.

      My app runs a find under a certain criteria and brings up several records that are then printed.

      This will happen several times a day.

      I want to print selected records only once; that is, whatever records resulted from the first find should not make the second list again, and so on.

      Any ideas as to how I could get that accomplished?

      Many thanks

        • 1. Re: Selective record printing

          Maybe you need a flag field which gets populated with a value when the record is printed, so that it can easily be omitted from future found sets.

          • 2. Re: Selective record printing

            That´s right! I just don´t see how to go about doing it

            • 3. Re: Selective record printing

              One approach could be to setup a Timestamp field, which you can use to set for all records printed at the time the script is ran. 


              In your Find script you mention, omit any records with a value in the Timestamp field.

              • 4. Re: Selective record printing

                The key detail is to use a script to print your records. That script can set whatever flag field and value you want and then print them.

                • 5. Re: Selective record printing

                  The flag or timestamp idea mentioned earlier work fine for this. Couple of things to watch out for:


                  1) What happens if the print fails for some reason? Once FileMaker dumps the job to the printer, it has no idea whether it succeeded or not. So you need some way to handle that (perhaps a way to reset the flag / timestamp manually, perhaps a confirmation dialog prior to setting the flag / timestamp, etc.).


                  2) What happens if another user happens to be editing one of the records when you try to set the flag? You'll not be able to touch that record (it's called "record lock"), and your flag or timestamp won't be set correctly. So you need to check for that error and manage it somehow. (Set Error Capture [On], followed by Get ( LastError ) checking for error code 301 will allow you to perform the check.)