Wednesday, November 27, 2013

XML FIle output from PeopleCode

Below is sample PeopleCode to export a Record View – PS_BCP1 to a xml file. Highlighted is the Target XML file name and Source table name.

Local XmlDoc &inXMLDoc;
Local XmlNode &rootNode, &childNode1, &childNode2, &textNode2;
Local string &xmlStr;
Local File &xmlFile;
Local number &i;

&xmlFile = GetFile("c:\temp\export_sample1.xml", "W", %FilePath_Absolute);

&inXMLDoc = CreateXmlDoc("");
&rootNode = &inXMLDoc.CreateDocumentElement("root");

Local Record &rec = CreateRecord(Record.BCP1);
Local SQL &sql = CreateSQL("SELECT * FROM PS_BCP1");

While &sql.Fetch(&rec)
   &childNode1 = &rootNode.AddElement(Lower(&rec.Name));
   For &i = 1 To &rec.FieldCount
      &childNode2 = &childNode1.AddElement(Lower(&rec.GetField(&i).Name));
      &textNode2 = &childNode2.AddText(&rec.GetField(&i).Value);
   End-For;
End-While;

&xmlStr = &inXMLDoc.GenFormattedXmlString();

&xmlFile.WriteLine(&xmlStr);


&xmlFile.Close();

Friday, October 18, 2013

PeopleSoft 9.1 has eMail approval feature - HCM



Announcing PeopleSoft HTML Email Approvals for HCM




 This is good feature to Approve/Deny requests by Managers via eMail itself instead of PIA. Per Oracle delivered template, they have the below delivered options for email approvals.

·         Job Opening
·         Job Offer
·         Absence Request
·         Extended Absence Request
·         Promote Employee
·         Transfer Employee
·         Reporting Change
·         Performance Document