2 Replies Latest reply on Feb 12, 2013 11:22 AM by alejandrogarcia

    is it possible to create a script to limit the amount of times a record is printed?

    alejandrogarcia

      Title

      is it possible to create a script to limit the amount of times a record is printed?

      Post

           First than all thanks for your help , I work for a condominium ,my goal is to be able to print our visitor parking only 10 times per month , I have no much experiense with scripts but I know where to set it up I already have the scrip that increase 1 averytime is activated and everything else the only script I need is to eather stop it from printing when file 1 hits number 10 or  just a message that can be activated also when it hits 10 ,  if you can help me with some kind of calculation I will really appresiate it , thanks a lot!

        • 1. Re: is it possible to create a script to limit the amount of times a record is printed?
          Sorbsbuster

               Do you want this as a security feature, to stop anyone ever printing more than 10, or do you want it just as a reminder to yourself that 10 have been printed?

               If you want to make it secure you may have to take more steps - such as stop anyone else having access to that layout.  (Although people can always photocopy existing permits...)

               You could add two fields to each Resident's record:
               DateLastPrinted
               and
               PrintCountThisMonth

               If I assume that you mean in a calendar month they can only have 10 prints, then you can set the script to check, before it goes through the printing steps, if:

               PrintCountThisMonth < 10
               and
               Year (Get (CurrentDate ) = Year ( DateLastPrinted )
               and
               Month (Get (CurrentDate ) = Month ( DateLastPrinted )

               If that test is passed, print the permit and then set those two fields at the end of the script:

               PrintCountThisMonth = PrintCountThisMonth + 1
               and
               DateLastPrinted = Get (CurrentDate )

               At the start of the script you should also re-set the fields if the month of the last print is not the same as the month now - the print count would be reset to 0, as it is a new month.

               I haven't tested any of that, of course!


                

          • 2. Re: is it possible to create a script to limit the amount of times a record is printed?
            alejandrogarcia

                 Thanks!! a lot I really appresiated I will give it a try thanks again