Adding and Deleting Printers in Lawson Scope of this document: It is our purpose to familiarize the client with the procedures and the options involved in creating and deleting printers from the Lawson environment without dictating a single method, to allow the client to become familiar with the concepts and fully utilize the multitude of functions that can be accomplished with the Printer Definition utility (prtdef). You can define output destinations. Output destinations include printers, saving to an output file, File Transfer Protocol (ftp) to a different system or any other output optin available to the Unix operating system. The maximum number of printers you can set up through prtdef is determined by the mPRINTERS parameter in the univ.cfg file. This is set to 200 by default. You can use the Printer Group Definition utility (prtgrpdef) to easily make multiple printers available to users and to restrict user output options, such as restricting access to check printers or limiting users to only the printers at their location. The Printer Group Reports (prtgrprpt) lists printers and users for all selected printer groups. Use the Lawson Systems ADministration guide to find out more about each of these commands. Defining a Printer Before you can define printers with the Printer Definition utility, you must set up the printers on your Unix system or network. Your Unix Systems Administrator can do the standard printer installation for your system. Use the following procedures to define a printer as an output destination. The procedures vary, depending on whether the print command needs to be greater than 50 characters. Steps to define a printer with a print command shorter than 50 characters 1. At the command prompt, type: prtdef 2. Move to the blank line at the bottom of the list of printers or press Insert (F8) to insert a blank line. 3. On the Printer Definition form, type the following data. Field Description Name: A unique name for the printer. Description: A short unique description of the printer. Print Command: Type the 50-character (or less) command in the correct UNIX syntax that sends the output to the desired destination. # NOTE Press Enter, Tab, or the down arrow key to access the Printer Command subform, where you can type the Lawson printer command (up to 50 characters). 4. Press Enter to save the printer command. 5. Press Enter twice to save the printer definition. Steps to create a printer command script file To create a print command greater than 50 characters, create a script file with the print command. 1. Navigate to the location you want to create the script. 2. Create the script file. Include the line: #!/bin/sh (or #!/bin/ksh) as the first line of the file in order to identify it as a script file. 3. Make the script file executable: chmod 777 filename 4. Type the name of the script file in the Print Command field on the Printer Definition form. If the script file is not in a directory predefined in the $PATH statement, specify the entire path name to the script. Example This is an example of a command to output to a printer: lp -dlaser The command above assumes the printer is named laser. This command might be different, depending on your operating system and printer. You can enhance the command to support any of the options your operating system and printer will accept, compressed, landscape, special fonts, etc… Remember that any command you can type at the commandline to process a file can be automated inside prtdef - provided it requires no user interaction. Example A user may want to transfer a print file from the UNIX server to their personal computer. You can define a printer that saves output to a file in a user’s home directory to enable the transfer. Field Description Name: A unique name for the printer. Description: A short unique description of the printer. Print Command: Type the 50-character (or less) command in the correct UNIX syntax that sends the output to the desired destination. # NOTE Press Enter, Tab, or the down arrow key to access the Printer Command subform, where you can type the Lawson printer command (up to 50 characters). Below are examples of the syntax used to call different printer commands Name Printer Print Command (50 Characters Max) Printer1P Printer 1 Portrait lp -dprinter1 Printer1L Printer 1 Landscape lp-dprinter1 -olandscape Printer1LC Printer 1 Landscape Compressed lp -dprinter1 -olandscape -oc -onb SaveFile Save Report to Home Directory > $HOME/lawson.rpt ftpfile ftp Report to a remote location /lawson/scripts/ftpfile.sh PrinterX Process with a shell script /lawson/scripts/lawprint.sh XP printer1 · In Unix terms, imagine that Lawson is executing `cat printfile |` and you are creating the remainder of the command to decide where it goes or how it’s processed. Deleting a Printer These procedures let you delete printer definitions. Use these procedures to remove the printer definitions for printers that you no longer use. Removing unneeded printers can help you avoid exceeding the maximum number of printer definitions, as defined by the mPrinters parameter in the Environment configuration file (univ.cfg). See “Setting the Maximum for Printer Definitions” on page 60 of the Lawson Systems Administration manual. There are two places you must delete printer definitions if you want to remove the printer definition entirely from the Lawson system. • From within printer groups • From within the Printer Definition utility Steps to delete a printer from within the printer groups 1. Access the Printer Group Definition (prtgrpdef) form: From the command line, type: prtgrpdef 2. On the Printer Group Definition form, select the printer you want to delete. 3. Press Delete (F9). If the printer is not any user’s default printer, the prtgrpdef utility prompts you to press OK (press Enter) to delete the printer from the group. If the printer you want to delete is a user’s default printer, the prtgrpdef utility prompts you for a replacement printer. You must select the replacement from those belonging to the user’s printer group. 4. Press Enter twice. Steps to delete a printer within the Printer Definition utility 1. At the command prompt, type: prtdef 2. On the Printer Definition form, select the printer to delete. 3. Press Delete (F9). In the following cases, the system will prompt you for a replacement printer when you attempt to delete a printer definition: • The printer is assigned as a user’s default printer. • The printer belongs to a distribution group. • The printer belongs to a distribution list group (because it belongs to a distribution group that belongs to the distribution list group). • The printer is assigned to a print file in the Report/Output Files subform (accessed through the Reports button on a parameter form). • The printer is assigned to a job step. The replacement printer must be a valid printer set up through the Printer Definition utility (except that in the case of printers assigned to job steps, the system does not check the validity of the replacement printer). If you use Mark and Bound to delete a number of printers, a replacement printer must be designated for each printer, if each is in use. 4. Press Enter twice. Access to the printer is removed from the printer groups to which it was assigned. IMPORTANT After you delete a printer definition, you should also remove it from any printer groups it belonged to. If a printer group is empty after deleting a printer, you should delete the printer group to prevent assigning an empty printer group to a user. J. David Schronce