2 Replies Latest reply on Jan 2, 2015 5:46 AM by Mike_Mitchell

    Script schedule


      Hi Gurus,


      Can you please share your FM expertise, I have a layout containing our materials expiring for the next month and materials needed to be retested for the next month.


      I need a script that will make a pdf, send & attached to an email every third Friday of the month to notify the recipients to prepare the materials needed for testing and to notify the warehouse people to prepare the paper works for disposal of the materials that are expiring.


      Thank you so much in advance.

        • 1. Re: Script schedule


          Their is not enough information in your post for someone to provide you with a perfect, appropriate script.

          Unless of course you post the file.

          I would suggest that you give it a go yourself and come back to the forum with specific questions as you work through the process.

          Trying it yourself will make you a better developer in the end.


          • 2. Re: Script schedule

            One thing that jumps out in your description is the need to create a PDF. Since you specified in your subject that this was a "schedule", it's worth pointing out that the "Save Records as PDF" script step is not server-compatible. You'll not be able to do this directly as a server-side scheduled script. You'll need to run it as a robot, i.e., a separate client running on an OnTimer script or a copy of Pro / Advanced running on the server itself.


            This points out an important caveat involved with creating server-side scripts: Always check the compatibility of the script steps you intend to use (lower left-hand corner of the Edit Script window) to make sure it will run properly in the environment you're intending it for.


            Other than that, a general outline of the process you're describing might look something like this:


            1) Navigate to the appropriate layout.

            2) Perform a Find for the necessary records.

            3) Perform a Sort appropriate for the report.

            4) Generate the PDF (either by printing using a PDF driver or using Save Records as PDF).

            5) Create the email using an established mailing list. I suggest creating a table for this purpose that contains the email addresses (so you can simply add / remove addresses rather than changing the script as needs change).


            Now go forth and experiment!