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();
Thursday, January 3, 2008
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);
&rec.FIELD1.Value = "123abc"; /* here you are setting the initialvalues needed by your application engine */
CallAppEngine("YouAppEngProg", &rec);
Wednesday, January 2, 2008
PeopleSoft blog & user group
http://blog.greysparling.com/2006/05/application-engine-development-tips.html
http://www.compshack.com/peoplesoft/application-engine/calling-application-engine-peoplecode
http://www.peoplesoftfans.com/psfans/forum/tools/messages/3044.html
http://en.allexperts.com/q/Peoplesoft-2100/Application-Engine-5.htm
http://www.compshack.com/peoplesoft/application-engine/calling-application-engine-peoplecode
http://www.peoplesoftfans.com/psfans/forum/tools/messages/3044.html
http://en.allexperts.com/q/Peoplesoft-2100/Application-Engine-5.htm
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 .........
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"
{
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'
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
Check if any changes to the record
SavePreChange
If Record.record.IsChanged Then
let record.field = 'Change';
End-If;
If Record.record.IsChanged Then
let record.field = 'Change';
End-If;
Subscribe to:
Posts (Atom)