Thursday, December 22, 2005

Debug PeopleCode using GetFile

To debug a peoplecode (See complete document), we can use File write very effectively.

Step 1

Declare a file variable
Local File &MYFILE;

Step 2
Add the following Code. replace ketan with your username to uniquely identify your name.

&MYFILE = GetFile("debugketan.txt", "W");
If &MYFILE.IsOpen Then
&MYFILE.WriteLine("your text");

Step 3:

This file will be created in unix under respective appserver


For e.g. if peoplecode is running on hrdev appserver the file will be created on

/disk01/psoft/hr84x/appserv/hrdev/files directory.

1 comment:

Larry said...

You can use Java object as well to do file processing. I saw good tips at website. Here is the snippet, how we can use Java

Local JavaObject &javaFile;&javaFile = CreateJavaObject("", "c:\temp\mytextfile.txt");