Adapting Form Letters
Form letters are useful for many administrative tasks besides those for which we deliver sample letters. You can modify the sample form letters in several ways, from simple changes to text in the templates to adding the Letter Code field to other pages in PeopleSoft Human Resources.
These topics discuss how to:
-
Modify the text in sample letter templates.
-
Add fields to sample letters.
-
Create new form letters.
-
Add letter code fields to pages.
Modifying the Text in Sample Letter Templates
The form letter templates that are delivered with PeopleSoft Human Resources contain sample text for different types of tasks that you can change to suit your needs. For example, you'll probably want to change the sender names in the letters to the names of the employees in your organization who are responsible for administering the tasks. If you need to modify only the text, without changing any fields that are used or pages and tables that are referenced in PeopleSoft Human Resources, use the following procedure.
To modify the text in a form letter:
-
Find the Word letter template to update.
Templates are located in the directory \PS\WINWORD.
-
In Microsoft Word, open the document that you want to modify.
If you see " " in the document, select then select the Field codes check box.
-
Make changes to the text as you would in any other document and save the file.
WARNING:
Don't overwrite the field codes (enclosed in curly brackets). They are the placeholders for the values that are extracted from PeopleSoft Human Resources.
Adding Fields to Sample Letters
In addition to updating the text of a sample letter, you can include other types of data from PeopleSoft Human Resources.
Note:
To make this change, you should be familiar with Microsoft Word fields and the report writer used to extract data values from your PeopleSoft Human Resources database.
To use additional fields in form letters:
-
Add field codes to the form letter templates for any new data types that you want to include.
-
Modify the SQR that extracts data from PeopleSoft Human Resources so that it retrieves values from all of the fields that you want to use and writes them to the appropriate data extract files.
For example, to include title in the Training Enrollment Confirmation letter ltrcon.doc, add a title field code to the form letter template. Also add a variable for title in TRN001.sqr so that the SQR retrieves the title value and writes it to the data extract file.
Here's what the data extract file looks like before the change:
systemdate, Name, . . .,"August 10, 2001", "Barry Robert Campbell"Here's what it looks like after the change:
systemdate, Name, Title...."August 10, 2001", "Barry Robert Campbell", "Director". . .
Creating New Form Letters
You can create form letters for different purposes. For example, you might want to create a form letter notifying students they are on the waiting list for a course session.
To create a new form letter:
-
Create a new letter code in the Standard Letter table.
-
Create a Word letter template, including the appropriate text, field codes, and data statement reference.
The file name of the template must match the data extract (.ltr) file name. For example, if the data extract file is app004.ltr, the Word template file must be called app004.doc.
You might find it easier to adapt an existing form letter template than to create a new one. Look through the form letter templates to see if there's one that needs only minor modifications to serve as a new form letter template.
For example, create a form letter for interview schedules (INT) by adapting the offer letter template. In the directory \PS\WINWORD, open ltrof1.doc. Modify the text as needed and add any new field codes that you want to use in the letter. Save the new template under a different name, ltrint.doc.
-
Edit the SQR that selects and extracts data from other PeopleSoft Human Resources tables and stores it in a separate data extract file.
Insert the MERGEFIELD field code where you want the merge process to insert data from the data extract file into the letter. Press ALT + F9 to insert the MERGEFIELD field code.
For example, to create a new form letter for interview schedules, you create new procedures in app007.sqr to extract values from all the fields and create a separate data extract file to store interview schedule letter information.
The SQR process must include the name and extension (.ltr) of the data extract file that is created. An example is:
begin-procedure Write-Heading move '{IMPORTPREFIX}' to $FileName !start a new report file do Get-prcsoutputdir if (rtrim($prcsoutputdir,' ') <> '') move $prcsoutputdir to $Filename concat 'APP004.LTR' with $Filename end-if NEW-REPORT $Filename Let $InputField1 = 'LANG,Audience,Job_Requisition,JobTitle,DeptID,DeptName,Min_Rt_⇒ Annual,Max_Rt_Annual,Name1,Value1,Name2,Value2,Name3,Value3,Name4,Value4,Name5,Val⇒ ue5,Name6,Value6,Name7,Value7,Name8,Value8,' Let $InputField2 = 'Name9,Value9,Name10,Value10,Name11,Value11,Name12,Value12,Name1⇒ ⇒ ⇒ ⇒ ⇒ ⇒ ⇒ ⇒ ⇒ ⇒ ⇒ ⇒ ⇒ ⇒ ⇒ 3,Value13,Name14,Value14,Name15,Value15,Name16,Value16,Name17,Value17,Name18,Value1⇒ ⇒ ⇒ ⇒ ⇒ ⇒ ⇒ ⇒ ⇒ ⇒ ⇒ ⇒ ⇒ ⇒ ⇒ 8,Name19,Value19,Name20,Value20,AsOfToday' Let $InputFieldTot = $InputField1 || $InputField2 move $InputFieldTot to $ioarea print $ioarea (1,1) next-listing end-procedureIf you create an Application Engine process, the file created by the process must have an .ltr extension.
See PeopleTools SQR for PeopleSoft Developers
-
Copy the new letter template to the Process Scheduler %PS_HOME%\winword directory.
-
Create a PSJOB to ensure that the SQR, WORDINIT, and PSMERGE processes are run in the correct order.
Define the job to include these steps in the following order:
-
SQR process or Application Engine data extract process.
-
WORDINIT Winword process.
-
PSMERGE application engine.
Note:
PeopleSoft recommends that you do not modify any of the delivered Winword macros or templates.
-
Note:
To link your new letter to PeopleSoft Process Scheduler, ask your human resources project leader or see the references below.
Adding Letter Code Fields to Pages
We deliver PeopleSoft Human Resources with Letter Code fields in several pages in Administer Training, Administer Workforce, and Manage Labor Relations.
You can add the Letter Code field to any other pages (and their underlying tables) in PeopleSoft Human Resources. For example, if you routinely send letters to employees, notifying them of career planning sessions, you can add the Letter Code field to one of the pages from the Plan Careers menu.
Note:
To make this change, you should be familiar with PeopleSoft Application Designer; Microsoft Word field codes, macros, and data statements; and the SQRs that are used to extract data values from your PeopleSoft Human Resources database.
When you add the Letter Code field to another page and its underlying table or tables in the system, also create:
-
A letter code that represents the particular application.
-
A form letter template with the appropriate text, field codes, and data statements.
-
An SQR that extracts data from the correct tables in PeopleSoft Human Resources and creates new data extract files.
-
A job containing the SQR, WinWord process WORDINIT, and the Application Engine PSMERGE.
See PeopleTools: Application Designer Developer's Guide "Working With Processes and Reports"
See PeopleTools: Process Scheduler.