Thursday, January 3, 2008

Scheduling a Process in PeopleCode

Here is a great example of how to schedule a process and email the results from within PeopleCode.You can do this within an App Engine Program or even by placing a pushbutton with FieldChange peoplecode.
Local ProcessRequest &RQST;
Local string &Subject;
Local string &Text;
&Subject = "Subject of Email";
&Text = "This text will be displayed as the text of this email ";
&RQST = CreateProcessRequest();
&RQST.RunControlID = "MYRUNCONTROL_ID";
&RQST.ProcessName = "PROCESSNAME";
&RQST.RunLocation = "PSUNIX";
&RQST.ProcessType = "SQR";
&RQST.OutDestType = "Email";
&RQST.OutDestFormat = "PDF";
&RQST.OutDest = "User : PS,Role : PeopleSoft User";
&RQST.EmailSubject = &Subject;
&RQST.EmailText = &Text;
&RQST.EmailAttachLog = False;
&RQST.Schedule();

Calling an Application Engine from PeopleCode

&rec = CreateRecord(RECORD.MY_INIT_VALUES);
&rec.FIELD1.Value = "123abc"; /* here you are setting the initialvalues needed by your application engine */
CallAppEngine("YouAppEngProg", &rec);

Sunday, December 30, 2007

Reading delimited variable length files

open 'file' as 1 for-reading record=2000:vary
read 1 into $rec
unstring $rec by ',' into $var1 $var2 $var3 .........

Wednesday, December 26, 2007

yesterday in UNIX

date '+%m %d %Y'
{
read MONTH
DAY YEAR DAY=`expr "$DAY" - 1`
case "$DAY" in
0)
MONTH=`expr "$MONTH" - 1`
case "$MONTH" in
0)
MONTH=12
YEAR=`expr "$YEAR" - 1`
;;
esac
DAY=`cal $MONTH $YEAR grep . fmt -1 tail -1`
esac
echo "Yesterday was: $MONTH $DAY $YEAR"

Encyption PGP to add to key ring

1. ftp in ascii format vendor_publickey.asc to /appsdhr/psoft/bea/pgp
2. /usr/local/bin/pgp-6.5.8/pgp -ka vendor_publickey.asc
3. view the 'user id' of the vendor key name in the key ring /usr/local/bin/pgp-6.5.8/pgp -kv
4. Substitute the 'user id' in the command below to accept key (note you need the quotes) /usr/local/bin/pgp-6.5.8/pgp -ks 'user id'
- you will be prompted for password - answer with ...
5. /usr/local/bin/pgp-6.5.8/pgp -e test.txt 'FTP Vendor'

PeopleSoft HR reports

http://download.oracle.com/docs/cd/B28716_01/psft/acrobat/hrr83all-r1001.pdf

Portal Security

http://www.erpassociates.com/peoplesoft-corner-weblog/security/understanding-portal-security-sync.html

PeopleBooks On-Line

http://www.peoplesoftcity.com/

Check if any changes to the record

SavePreChange
If Record.record.IsChanged Then
let record.field = 'Change';
End-If;