Compiling All PeopleCode Programs at Once

In addition to checking individual programs, you can compile all PeopleCode programs either in a database or in a project to check for errors. This option opens and compiles every PeopleCode program. This process can be run on an as-needed basis to check for corruption in your programs. Run this option after an upgrade to verify that all the programs were upgraded correctly.

You run this option from the Tools menu:

Image: Tools menu - Compile All PeopleCode option

This example illustrates the fields and controls on the Tools menu - Compile All PeopleCode option. You can find definitions for the fields and controls later on this page.

Tools menu - Compile All PeopleCode option

To compile all PeopleCode programs:

  1. Open Application Designer while accessing the database that contains the PeopleCode that you want to check.

  2. Select Tools, Compile All PeopleCode

  3. Select which PeopleCode to compile.

  4. Click Compile in the Compile All PeopleCode dialog box.

    Errors appear in the PeopleCode log display window. Warnings and auto-declared variables do not appear in the log display window, however the number of warnings and the number of auto-declared variables appear in the log display window.

    Note: If you specified a log file in the debugger log options, then all errors are written to the log file as well.

Image: Compile All PeopleCode dialog box

This example illustrates the fields and controls on the Compile All PeopleCode dialog box. You can find definitions for the fields and controls later on this page.

Compile All PeopleCode dialog box

Field or Control

Definition

Compile all PeopleCode

Select this option to validate every PeopleCode program in the database.

Compile all and Save all PeopleCode

Select this option to open, compile and save every PeopleCode program.

Compile and Save Directive PeopleCode

Select this option to open, compile and save directive PeopleCode.

You can also compile PeopleCode from the command line, including the ability to compile directive PeopleCode.

Directive PeopleCode

Directive PeopleCode provides the ability write PeopleTools release specific PeopleCode. Using directive PeopleCode you can conditionally ignore PeopleCode objects in PeopleCode events based on the PeopleTools release. Directive PeopleCode uses #If #ToolsRel and #End-If. For example:

#If #ToolsRel >= "8.54" #Then
   &PhotoSizeName = "CARD";
#Else
&PhotoSizeName = "ORIG";
#End-If

The PeopleTools release is stored in the PSPCMPROG table in the PTTOOLSREL field. When directive PeopleCode is compiled, the system will check the PeopleTools release for the database and compile the correct code for that PeopleTools release.

Note: Compiling directive PeopleCode is included as a step in all PeopleTools upgrades.

For more information on directive PeopleCode functions and constructs, see Directive PeopleCode Functions and Constructs.

To compile all PeopleCode programs:

  1. Open Application Designer while accessing the database that contains the PeopleCode that you want to check.

  2. Open the project containing the PeopleCode to compile.

  3. Select Tools, Compile Project PeopleCode.

    Errors appear in the PeopleCode log display window.

    Note: If you specified a log file in the debugger log options, then all errors are written to the log file as well.