Thursday, April 14, 2011

Peoplesoft Recruitment module Table



HRS_LOCATION --INTERVIEW LOCATION DETAILS
HRS_CONTACT --COMPANY CONTACT DETAILS
HRS_JO_RCTR_RL ---RECRUITER ROLE
HRS_JO_DSC_TYP --POSTING DESCRIPTIONS
HRS_JO_PST_LIB --POSTING DESCRIPTIONS LIBRARY
HRS_JOB_OPENING ---JOB OPENING
HRS_STS_JO_I --JOB OPENING STATUS CODE
HRS_APPLICANT --APPLICANT DETAILS
HRS_RCMNT --RECRUITMENT SUMMARY
HRS_STS_REC_I --RECRUITMENT STATUS
HRS_APP_RTE --ROUTE
HRS_RCM_INT --]INTERVIEW DETAILS
HRS_STS_INT_I --]INTERVIEW STATUS CODES
HRS_OFFER --OFFER DETAILS
HRS_STS_OFF_I --OFFER STATUS
HRS_TEAM --TEAM DETAILS

Friday, April 8, 2011

Running XML Publisher report in AE using PS Query Data Source

/*fill prompt record*/
&rcdQryPrompts = &ReportDef.GetPSQueryPromptRecord();
If Not &rcdQryPrompts = Null Then
    If Not Prompt(&ReportDef.GetDataSource().Name, "",&rcdQryPrompts) Then         Exit;
    End-If;
    &ReportDef.ProcessReport(&sTemplateId, %Language_User%Date, &sOutputFormat);
End-If;


Peoplecode for calling SQR 

Local ProcessRequest &RQST;

&sRunCntlId = "Test";

&aProcessType = "SQR Report"/*(or "SQR Process")*/
&aProcessName = "MYSQRRPT";

&dttmRunDateTime = %Datetime;
&aTimeZone = "EST";
&aOutDestType = "WEB";
&aOutDestFormat = "PDF";

/* Create the ProcessRequest Object */
&RQST = CreateProcessRequest();

/* Set all the Required Properties */
&RQST.RunControlID = &aRunCntlId;
&RQST.ProcessType = &aProcessType;
&RQST.ProcessName = &aProcessName;

/* Set any Optional Properties for this Process */
&RQST.RunDateTime = &dttmRunDateTime;
&RQST.TimeZone = &aTimeZone;
&RQST.OutDestType = &aOutDestType;
&RQST.OutDestFormat = &aOutDestFormat;

/* Schedule the Process */
&RQST.Schedule();

Creating Word Document Using App Engine

&oWORD = CreateObject("COM", "Word.Application");
ObjectSetProperty(&oWORD, "Visible", True);

&oWORD.Documents.Add();
&oPara1 = &oWORD.Selection;
&oPara1.Style = "Heading 1";            
&oPara1.TypeText("Hello World ");
&oPara1.Font.Bold = True;
&oPara1.TypeText("Bold ");
&oPara1.Font.Bold = False;
&oPara1.Font.Italic = True;
&oPara1.TypeText("Italic ");
&oPara1.Font.Italic = False;
&oPara1.Font.Underline = True;
&oPara1.TypeText("Underline ");
&oPara1.Font.Underline = False;
&oPara1.Font.Name = "Arial";
&oPara1.TypeText("Arial ");
&oPara1.Font.Name = "Times Roman";
&oPara1.Font.Size = "16";
&oPara1.TypeText("Times Roman ");
&oPara1.Font.Size = "12";
&oPara1.TypeText("Example ");
&oPara1.Start = "50";
&oPara1.End = "59";
&oPara1.Font.Name =

Multiple Reports in SQR

Multiple Reports feature is very handful  when you need to stream the output to different reports based on some business conditions. DECLARE-REPORT and USE_REPORT are two commands used to accomplish this. Below example generates two reports based on the employee salary. each report will have a separate header.



declare-report rep1
   layout=layout1
end-declare

  declare-report rep2
    layout=layout2
  end-declare
 END-SETUP

 begin-heading 4 for-reports=rep1
  
    print 'Employee Listing Grade B' (1,1) center bold shade
    print '=' (+1,1,80) fill
    print 'EID' (3,1) bold
    print 'EName' (,10) bold
    print 'Salary' (,30) bold
 end-heading


 begin-heading 4 for-reports=rep2
    
    print 'Employee Listing Grade A' (1,1) center bold shade
    print '=' (+1,1,80) fill
    print 'EID' (3,1) bold
    print 'EName' (,10) bold
    print 'Salary' (,30) bold
 end-heading





BEGIN-PROGRAM
BEGIN-SELECT
NS_EID
NS_ENAME
NS_SALARY
    if &ns_salary <35000
      use-report rep1 
    else
      use-report rep2
    end-if
  
    print &NS_EID (+1,1)
    print &NS_ENAME (,10)
    print &NS_SALARY (,30)
FROM PS_NS_EMP_TBL
end-select
end-program
Query to find all record in a component

SELECT DISTINCT (recname)
FROM psrecdefn
WHERE recname IN
(SELECT DISTINCT (recname)
FROM pspnlfield
WHERE pnlname IN
(SELECT DISTINCT (b.pnlname)
 FROM pspnlgroup a, pspnlfield b
WHERE (   a.pnlname = b.pnlname OR a.pnlname =b.subpnlname)
AND a.pnlgrpname = 'VNDR_ID' -- specify your component name)
AND recname <> ' ')
UNION
SELECT DISTINCT (recname)
FROM pspnlfield
WHERE pnlname IN
(SELECT DISTINCT (b.subpnlname)
 FROM pspnlgroup a,pspnlfield b
WHERE (a.pnlname = b.pnlname OR a.pnlname = b.subpnlname )
AND a.pnlgrpname = 'VNDR_ID') -- specify your component name)
AND recname <> ' ')
AND rectype = '0' -- specify record type
ORDER BY recname ASC
Publishing XML Publisher report using peoplesoft Application Engine and sending email notification to user with genrated report.

import PSXP_RPTDEFNMANAGER:*;
import PSXP_XMLGEN:*;
import PT_MCF_MAIL:*;


/*Create an email object by setting individual parameters*/
Local PT_MCF_MAIL:MCFOutboundEmail &eMail = create
PT_MCF_MAIL:MCFOutboundEmail();

&sRptDefn = "JOB_DEFN";
&sTemplateId = "JOB_TEMP";
&sLangCode = "";
&dtAsOfDate = %Date;
&sOutputFmt = "PDF";
&RptOutputDir = "c:\temp\" "XMLP";

&ReportDef.OutDestination = &RptOutputDir;

/*Set-Up Report*/
&ReportDef = create PSXP_RPTDEFNMANAGER:ReportDefn(&sRptDefn);
&ReportDef.Get();

/*Create Rowset*/
&rs = CreateRowset(Record.PERSONAl_DATA);


/*Fill Rowset*/&rs.FILL("WHERE FILL.EMPLID LIKE 'EID000%'");

/*Create Schema*/
&rds = create PSXP_XMLGEN:RowSetDS(); /*package method*/
&mySchema = &rds.GetXSDSchema(&rs);
&f1 = GetFile("c:\temp\JOB_XSD.xsd""W"%FilePath_Absolute);
&f1.WriteLine(&mySchema);
&f1.Close();


/*Create Sample XML File*/
&myXMLFile = &rds.GetXMLData(&rs, "c:\temp\JOB_XSD.xsd");
&f2 = GetFile("c:\temp\JOB_XML.xml""W"%FilePath_Absolute);
&f2.WriteLine(&myXMLFile);
&f2.Close();


/* output format */
&sOutputFormat = &sOutputFmt;

/*Provide a Data Source for the Report*/
&ReportDef.SetRuntimeDataRowset(&rs);

/*Generate the Report*/
&ReportDef.ProcessReport(&sTemplateId, %Language_User%Date, &sOutputFormat);

/*Publish the Report*/
&ReportDef.Publish("", &RptOutputDir, "XMLP", JOB_AET.PROCESS_INSTANCE);
&sFileExt = GetFileExtension(&sOutputFormat);


/*Send Mail*/&ToList = "to_user@yahoo.com";&FromList = "from_user@acme.com";&ReplyToList = "
from_user@acme.com";
&Subject = "Batch Run Email";
&eMail.Recipients = &ToList; /*comma separeted list of email addresses*/
&eMail.From = &FromList/*from email address*/&eMail.ReplyTo = &ReplyToList; /*in case the reply is to be sent to a different email address*/
&eMail.Subject = 
&Subject;

/*Body for multiple parts*/
Local string &plain_text = "Test for XML Email from PeopleSoft";
Local PT_MCF_MAIL:MCFBodyPart &text = create
PT_MCF_MAIL:MCFBodyPart();
&text.Text = &plain_text;

Local 
PT_MCF_MAIL:MCFBodyPart &attach = createPT_MCF_MAIL:MCFBodyPart();&attach.SetAttachmentContent(&RptOutputDir "JOB_DEFN.pdf",%FilePath_Absolute, "JOB_DEFN.pdf", "JOB_DEFN""""");

Local 
PT_MCF_MAIL:MCFMultiPart &mp = createPT_MCF_MAIL:MCFMultiPart();
&mp.AddBodyPart(&text);
&mp.
AddBodyPart(&attach);
&eMail.Multipart = &mp;

/*Override the default SMTP parameters specified in app server configuration file*/
&eMail.SMTPServer = "smtp.service.acme.com"/*just an example*/
&eMail.SMTPPort = 25/*usually this is 25 by default*/

Local integer &resp = &eMail.Send();
/*now check &resp for the result*/
Local boolean &done;
Evaluate &resp
When %ObEmail_Delivered
/*every thing ok*/
&done = True;
Break;
When %ObEmail_NotDelivered
/*check &eMail.InvalidAddresses, &eMail.ValidSentAddresses and &eMail.ValidUnsentAddresses*/
&done = False;
Break;
When %ObEmail_PartiallyDelivered/*check &eMail.InvalidAddresses, &eMail.ValidSentAddresses and &eMail.ValidUnsentAddresses*/
&done = True;Break;
When %ObEmail_FailedBeforeSending
/*get the formatted messages from &eMail.ErrorDescription, &eMail.ErrorDetails*/
&done = False;
Break;
End-Evaluate;


CommitWork();