iseries Electronic Document Management: A step-by-step Guide for automating distribution of documents by email without custom programming. How to Email Forms Using SpoolFlex and FormFlex
Overview... 0 Step 1: Create/Check a Spooled Data Map (SDM)... 2 Step 2: Define/Check Form Header Information... 3 Verify the Form Header General Information values... 4 Verify Invoice Form prints... 7 Step 3: Create Report Distribution to Distribute Forms via Email... 9 Run the Report Distribution... 15 Step 4: Create a Spool Sentry to automate emailing of the invoices to customers... 16 Run a Spool Sentry... 18 Edition Notice Revised Edition (October 2012) 11585 Jones Bridge Rd Suite 420-210 Alpharetta, GA 30022 Phone: 678.417.1521 Fax: 678.417.1501 E-Mail: support@drvtech.com Web: www.drvtech.com Copyright DRV Technologies Inc. 2010. All Rights Reserved
Overview IMPORTANT! Before proceeding with this tutorial you should have: Installed the SpoolFlex software onto your AS/400 or iseries Activated the software and completed a phone demonstration of SpoolFlex/FormFlex with a Sales Consultant at DRV Technologies. To schedule a 20 minute phone demonstration call 678-417-1521 Purchased E-delivery or Advanced Utilities module in order to use Email through Spoolflex/Formflex Set up and tested Email through SpoolFlex Completed the SpoolFlex Quick Start Guide Completed the SpoolFlex e-delivery Tutorial Completed the SpoolFlex Advanced Utilities Tutorial Completed the FormFlex Tutorial This How To document outlines steps for working with a spooled file that contains multiple invoices. We will split this spooled file apart by customer number and merge the splits with the form overlay. Then we will email these files to each customer by using an Address Book. At the end we will automate this process by setting up a Spool Sentry. All of the following steps assume the following: A spooled file containing some invoices already exists in an Output Queue. Each invoice contains a Customer Number that will be used to email it. You can execute command SFLEX to display the SpoolFlex Main Menu You can execute command FFLEX to display the FormFlex Main Menu You can use a sample spooled file provided by SpoolFlex to follow this document.
Create sample spooled files: Go to Manage Spooled Files menu. Put SFOUTQ into the Output Queue field and *LIBL into the Library field and press <enter>. Press F6 to Create sample SPLFs and then press F5 to refresh the list. You should see the following entries in the list that is displayed: You can use the spooled file with the Form Type SAMPINV. It contains multiple customers, so you can split it.. Press F12 to return to the SpoolFlex Main menu. *NOTE*: These spooled files can be used with the exercises in our manuals or if you are just playing with the software and need some sample spooled files for testing purposes. How to Distribute Forms via Email.doc 1
Step 1: Create/Check a Spooled Data Map (SDM) *NOTE*: If you have never created an SDM, you can see how it is done in the Advanced Utilities Tutorial. Go to the Spooled Data Map menu and check if you have the SAMPLE INVOICE MAP data map. If you have one there, then put 2 to edit it and then check if you have the following SDFs: CUSTOMER NUMBER and INVOICE NUMBER. If you don t have this Data Map, then create it. Add two SDFs to it. The end result should have entries that look like this: CUSTOMER NUMBER 4 22 4 1 INVOICE NUMBER 2 78 12 1 You now have a Spool Data Map named SAMPLE INVOICE MAP that contains two Spool Data Fields: CUSTOMER NUMBER and INVOICE NUMBER. These fields will be used later in an exercise to split a spooled file by customer number and then email all the invoices to each customer. How to Distribute Forms via Email.doc 2
Step 2: Define/Check Form Header Information *NOTE*: The process of designing a Form is not included in this exercise. If you don t have your own form, then you can use our SAMPLE INOICE EMAIL form. In this step you will: Define Form Header information for splitting a spooled file by customer number Print Invoices using the individual spooled files generated by the file splitting Verify the results Go to FormFlex main menu and then select option 1. Design Forms. Enter 13 next to SAMPLE INVOICE EMAIL form and press <enter>. How to Distribute Forms via Email.doc 3
Verify the Form Header General Information values Verify that the values look similar to those shown below. The New Spooled File Output section shows that once the new file is created, it will have the following: It will be sent to the Output Queue (SFOUTQ) defined in the Printer Definition, SAMPLE It will be assigned a new Form Type, INVEDOC It will have a Hold status of*yes, so that it won t print *NOTE*: Check that the SAMPLE printer definition is pointing to the SFOUTQ outque. Check on the new File Attributes section Press F8 Select New SPLF Attributes Press <enter> to get to the New Spooled File Attributes 2 of 2 screen. How to Distribute Forms via Email.doc 4
This screen shows the values that will be stored when the form is merged with the spooled file. During the Distribution process, you will use some data from the spool pages, such as Customer Number, etc. This data cannot be extracted from the merged ASCII file, so it needs to be extracted and stored into some File Attributes, like User Data and User Defined Data, during the merge process. *NOTE*: You may specify variations of these stored values depending on what data you want to be available during a Distribution process. The CUSTOMER NUMBER will be placed into User Data attribute (&SPLUSD). It will be used to get email address from the Address book, so that we can Email this invoice to that customer. The INVOICE NUMBER will be placed into &SPLUDD1 attribute. Once you verify the values are accurate, press <enter> to continue. Check on the Page Breaking section Press F8 Select Page Breaks (Bursting) How to Distribute Forms via Email.doc 5
This screen shows that we will be splitting the spooled file by the CUSTOMER NUMBER. Press <enter> until you come out of the form and back to the Design Forms screen. You have now verified that the SAMPLE INVOICE EMAIL form is defined to select the correct spooled files(s). It will output to the desired output queue and it will split the spooled file by the CUSTOMER NUMBER. How to Distribute Forms via Email.doc 6
Verify Invoice Form prints *NOTE*: If you have a drive mapped to /DRV on the IFS and if you are logged onto it, you can use option 9=Print View to display on your screen what the printed version would look like. (You also need to have PCL2PDF code). When prompted for a page range, press <enter>. See below how the merged spooled file with the form overlay looks: *NOTE*: You can also use option 6 to send the merged file to the printer to see how the output would look once it is emailed. How to Distribute Forms via Email.doc 7
On the command line, run this command: FFAEDOC EDOCNM( SAMPLE INVOICE EMAIL') Once it is done running, check out the merged files created in the SFOUTQ outque. Notice that merged files have Pages = 1*. This means they are ASCII spooled files (cannot use option 5=Display to view them). The User Data column now contains the Customer Number pulled from the spooled page. Use option 8 to display the spooled file attributes (page down a few screens). User defined data contains the Invoice Number values. How to Distribute Forms via Email.doc 8
Step 3: Create Report Distribution to Distribute Forms via Email From the FormFlex Main Menu select option 7. Report Distributions. If you already have a Report Distribution named SAMPLE INVOICE EMAIL, use option 2 to Edit it. Otherwise, press F6 to create it. How to Distribute Forms via Email.doc 9
*NOTE*: This Report Distribution will select and process files generated by the FormFlex process, that split the spooled file apart and then added the overlay to the splits. Select Spooled Files from Output Queue Output Queue where merged files are located (SFOUTQ) Form Type Merged files are identified with this form type (INVEDOC) Move Selected SPLFs to OUTQ Name After the individual Invoices are distributed, we delete them with (*DELETE) Contains Form overlay (ASCII, AFP, PCL) - This field is set to *YES since we are working with the ASCII files created by the FFAEDOC command Press <enter> to continue. How to Distribute Forms via Email.doc 10
If you don t see any Distribution Entries here, then press F6 to create one. Otherwise use option 2 to Edit it. The original file has been already split apart by the FormFlex Process, so we will be distributing complete report (*YES) with the *EML (email) as the Distribution Method. Press <enter> to continue. How to Distribute Forms via Email.doc 11
We stored the Customer Number in the &SPLUSD (user data) file attribute. We will reference that number in the address book, so put *YES in the Spoolflex Address Book field. Press <enter> to continue. In the From Spooled File Attribute field enter &SPLUSD (user data) variable, since it contains the Customer number value. The output will be converted to *PDF by using SAMPLE INVOICE PDF output definition. Press <enter> to continue. How to Distribute Forms via Email.doc 12
Press <enter> to continue. Files that didn t get distributed will go to the exception outque, SFOUTQ2. You can email them from there. Press <enter> to continue. How to Distribute Forms via Email.doc 13
This screen is used for defining the Email Subject, Email Message and Send Email From sections. Here &SPLUDD1 variable contains the value of Invoice Number. *NOTE*: If you put *JOBUSR or *SPLUSR in the Entry Value field, then make sure their profiles are setup with the correct email address in the User Defaults menu. We now have a Report Distribution that selects merged spooled files (with the Invoice Overlay) and then distributes them via Email. How to Distribute Forms via Email.doc 14
Run the Report Distribution Put D next to the SAMPLE INVOICE EMAIL report distribution and press <enter>. Press <enter> to continue. If all is setup and defined correctly, you should see some messages appear at the bottom of the screen as the files are processed and emailed. Once the distribution is complete, the Work with Report Distribution menu will re-display. Press F12 to return to the SpoolFlex Main Menu. How to Distribute Forms via Email.doc 15
Step 4: Create a Spool Sentry to automate emailing of the invoices to customers *NOTE*: If you have never created a Spool Sentry, then read about it in the Advanced Utilities Tutorial. Now that we have all the parts working, we can automate the process by putting all of the parts into a Spool Sentry. This sentry can be defined to run at pre-determined days and time. Define a Spool Sentry that will: Split spooled file by Customer Number and then merge the splits with the Form Overlay. The result of the split would be ASC files with Hold status in some output queue. Distribute the merged ASC files via Email (convert them to *PDF document) From the FormFlex Main Menu, select option 5. Spool Sentry If the Spool Sentry SAMPLE INVOICE SNTRY does not exist, use F6 to create it. Otherwise, use option 2 to edit it. *NOTE*: If Subsystem Status is NOT ACTIVE, then start it with F14 How to Distribute Forms via Email.doc 16
Enter the values as shown below. This Spool Sentry is setup to run once a day on Monday through Friday at 9:00 pm. Press <enter> to continue. We will need two entries: one to process a Form (FFAEDOC command) and one to run a Report Distribution (SFARDST command). Press F6 to add them if they are not already there. How to Distribute Forms via Email.doc 17
The FFAEDOC command will run the FormFlex Print Form API, that will split the spooled file by customer number; merge the split files with the form overlay; and then put the merged files to an Output Queue where they will be emailed from. This command is going to use SAMPLE INVOICE EMAIL form. The SFARDST command will run the SpoolFlex Report Distribution API, that will select the merged files generated by the previous FFAEDOC command and email them. This command is going to use SAMPLE INVOICE EMAIL report distribution. Press <enter> to come out of this Spool Sentry. Run a Spool Sentry If you have a spooled file with invoices ready to be processed and distributed, you can test the Spool Sentry by doing the following: 1) Make sure that there are no merged files in the SFOUTQ outque. If they are there, then delete them. 2) Release the Sentry and then submit it with option S (select IMMEDIATE). *NOTE*: Make sure that SFLEX subsystem is ACTIVE before running the sentry You have now completed this How To document. If you have any questions, suggestions or comments, please email them to support@drvtech.com You can also call us at 678-417-1521. How to Distribute Forms via Email.doc 18