Wednesday, November 14, 2012

Menu navigation from Process name

  Select distinct RTRIM(LTRIM(c.PORTAL_LABEL)) LBL1, '>' L1,RTRIM(LTRIM(b.PORTAL_LABEL)) LBL2, '>' L2,RTRIM(LTRIM(a.PORTAL_LABEL)) LBL3,e.DESCR,d.prcsname  from
    (SELECT MA.PORTAL_PRNTOBJNAME,PORTAL_URI_SEG2,   MA.PORTAL_LABEL FROM SYSADM.PSPRSMDEFN MA  WHERE MA.PORTAL_REFTYPE = 'C' ) a,
    (SELECT MA.PORTAL_OBJNAME,MA.PORTAL_PRNTOBJNAME, MA.PORTAL_LABEL FROM SYSADM.PSPRSMDEFN MA  WHERE MA.PORTAL_REFTYPE = 'F') b,
    (SELECT MA.PORTAL_OBJNAME,MA.PORTAL_PRNTOBJNAME, MA.PORTAL_LABEL FROM SYSADM.PSPRSMDEFN MA  WHERE MA.PORTAL_REFTYPE = 'F') c,
      ps_prcsdefnpnl d,
      ps_prcsdefn e
           Where a.PORTAL_PRNTOBJNAME=b.PORTAL_OBJNAME
           and b.PORTAL_PRNTOBJNAME=c.PORTAL_OBJNAME
           and a.PORTAL_URI_SEG2=d.pnlgrpname
           and d.prcsname = 'ABFI111'
           and d.prcsname=e.prcsname; ---Give Component Name to find path

Thursday, September 27, 2012

Component Path Finder SQL-Simplified

Select RTRIM(LTRIM(c.PORTAL_LABEL)) LBL1, '>' L1,RTRIM(LTRIM(b.PORTAL_LABEL)) LBL2, '>' L2,RTRIM(LTRIM(a.PORTAL_LABEL)) LBL3  from
    (SELECT MA.PORTAL_PRNTOBJNAME,PORTAL_URI_SEG2,   MA.PORTAL_LABEL FROM SYSADM.PSPRSMDEFN MA  WHERE MA.PORTAL_REFTYPE = 'C' ) a,
    (SELECT MA.PORTAL_OBJNAME,MA.PORTAL_PRNTOBJNAME, MA.PORTAL_LABEL FROM SYSADM.PSPRSMDEFN MA  WHERE MA.PORTAL_REFTYPE = 'F') b,
    (SELECT MA.PORTAL_OBJNAME,MA.PORTAL_PRNTOBJNAME, MA.PORTAL_LABEL FROM SYSADM.PSPRSMDEFN MA  WHERE MA.PORTAL_REFTYPE = 'F') c
           Where a.PORTAL_PRNTOBJNAME=b.PORTAL_OBJNAME
           and b.PORTAL_PRNTOBJNAME=c.PORTAL_OBJNAME
           and a.PORTAL_URI_SEG2='ITEM_TYP_FISCAL' ---Give Component Name to find path
           ;

Component Path Finder SQL-Simplified

Select RTRIM(LTRIM(c.PORTAL_LABEL)) LBL1, '>' L1,RTRIM(LTRIM(b.PORTAL_LABEL)) LBL2, '>' L2,RTRIM(LTRIM(a.PORTAL_LABEL)) LBL3  from
    (SELECT MA.PORTAL_PRNTOBJNAME,PORTAL_URI_SEG2,   MA.PORTAL_LABEL FROM SYSADM.PSPRSMDEFN MA  WHERE MA.PORTAL_REFTYPE = 'C' ) a,
    (SELECT MA.PORTAL_OBJNAME,MA.PORTAL_PRNTOBJNAME, MA.PORTAL_LABEL FROM SYSADM.PSPRSMDEFN MA  WHERE MA.PORTAL_REFTYPE = 'F') b,
    (SELECT MA.PORTAL_OBJNAME,MA.PORTAL_PRNTOBJNAME, MA.PORTAL_LABEL FROM SYSADM.PSPRSMDEFN MA  WHERE MA.PORTAL_REFTYPE = 'F') c
           Where a.PORTAL_PRNTOBJNAME=b.PORTAL_OBJNAME
           and b.PORTAL_PRNTOBJNAME=c.PORTAL_OBJNAME
           and a.PORTAL_URI_SEG2='ITEM_TYP_FISCAL' ---Give Component Name to find path
           ;

Monday, August 20, 2012

PeopleSoft Help: Download or import files from PeopleSoft Record PS...

PeopleSoft Help: Download or import files from PeopleSoft Record PS...: /* -----------------------------------------------------------------------------------*/ /* 2011-07-10 Vrao Polavarapu                    ...

Download or import files from PeopleSoft Record PSFILE_ATTDET

/* -----------------------------------------------------------------------------------*/
/* 2011-07-10 Vrao Polavarapu                                                         */
/* Download files from PSFILE_ATTDET . This code can be used to import from
other file attachment records also.*/
/* -----------------------------------------------------------------------------------*/
/*  Vrao - Start */
Local File &MYFILE1, &MYFILE2;
Local SQL &crsql;
Local integer &cnt;
Local string &STRTEXT;

MessageBox(0, "", 0, 0, "READ FILE RECORD STARTED [" | %Datetime | "]");

&crsql = CreateSQL("Select count(*) from PSFILE_ATTDET where ATTACHSYSFILENAME like 'myusername%' and  trunc(LASTUPDDTTM) > sysdate -24", &cnt);

/*Select ATTACHSYSFILENAME from PSFILE_ATTDET where ATTACHSYSFILENAME like 'myusername%' and  trunc(LASTUPDDTTM) = to_date('07/10/2011','mm/dd/yyyy') */

MessageBox(0, "", 0, 0, "Total number of files to download: [" | &cnt | "]");

&crsql = CreateSQL("Select ATTACHSYSFILENAME from PSFILE_ATTDET where ATTACHSYSFILENAME like 'myusername%' and  trunc(LASTUPDDTTM) > sysdate -24");

While &crsql.Fetch(&ATTACHSYSFILENAME);

&URL="record://PSFILE_ATTDET";

   &Rt = GetAttachment(&URL, &ATTACHSYSFILENAME, "C:\Temp\" | &ATTACHSYSFILENAME);
   /*if you want to read everyfile and write to a separate file, use the following code*/
   /*  &MYFILE1 = GetFile(&ATTACHSYSFILENAME, "r", "a", %FilePath_Absolute);
   &MYFILE2 = GetFile("C:\temp\" | &ATTACHSYSFILENAME, "w", "a", %FilePath_Absolute);

   While &MYFILE1.ReadLine(&STRTEXT);
      &MYFILE2.WriteLine(&STRTEXT);
   End-While;
   &MYFILE1.Close();
   &MYFILE2.Close();
*/
   MessageBox(0, "", 0, 0, " Name of the file downloaded: [" | &ATTACHSYSFILENAME | "]");
End-While;
/*  Vrao -End*/

Thursday, May 3, 2012

PeopleSoft Help: Campus Solutions Teminology

PeopleSoft Help: Campus Solutions Teminology: Campus Solutions Teminology Courtesy: Collected from online. ----------------------------------------------------------- PeopleSof...

Campus Solutions Teminology

Campus Solutions Teminology


Courtesy: Collected from online.
-----------------------------------------------------------

PeopleSoft Term 
 Description 

Academic Career 
 All coursework a student undertakes at an academic institution and that is grouped into a single student record. 

Academic Group 
 Used to group academic programs and courses. 

Academic Institution 
 The University of Nebraska: Lincoln, Kearney, Omaha, Medical Center 
The State College System: Chadron, Peru, and Wayne 

Academic Level 
 Calculated based on the rules defined for an academic program and number of units of course weight a student has successfully completed within an academic career. 

Academic Load 
 Calculated based on rules for the academic program, or it can be manually set based on other factors. 

Academic Organization 
 Units responsible for programs, plans, and/or courses. 

Academic Plan 
 Major, minor. An area of study within an academic program or academic career. 

Academic Program 
 Degree (BS, PhD). The entity that a student applies to, is admitted to, and graduates from. 

Academic Structure 
 Defines how programs (including degrees, majors, specializations, and concentrations) are organized. 

Academic Sub-plan 
 Specialty, concentration. An area of further specialization within an academic plan. Sub-plans are always linked or attached to a Plan. 

Action Date 
 The date the information was updated to the system. 

Action Reason 
 Indicates why a particular program action was taken, or offers further description of the program action. 

Adjustment Calendar 
 How student fees get refunded after that students withdrawal. Controls how a particular charge is adjusted on a student’s account when they drop classes or withdraw from a term. The charge adjustment is based on how much time has lapsed from a predetermined date and applies by percent of the original charge 

Admission Comments 
 Comments related to a student’s application for admission which are used in communications with the applicant and can be displayed in self service. 

Admit Term 
 The term for which an applicant has applied for admission. 

Areas of Study (AOS) 
 A plan type to denote the program relationship for graduate students with their degree program area (i.e., department, division, or research group). 

Auto Enroll 
 A feature set up in the class schedule which automatically enrolls the student in a related class (i.e, when a student registers for a class that has a required lab, the system enrolls them into the lab). 

Auto Populate 
 Once a specific field is filled in, tabbing out of that field will cause other specific fields in that section to automatically fill in as well.



Billing Careers 
 If a student is actively simultaneously in multiple careers, some of these careers may be grouped for billing purposes under the name of one of the careers. This one career is called the billing career. 

Block/Allow Enrollment 
 Block prevents enrollment in a course. Allow gives permission to enroll in a course. Blocks and allows are recorded by course, not by student. 

3 C’s 
Communications Record 
Comments 
Checklists 
 A flexible way to track and analyze correspondence, lists of requirements, and notes about the students, staff, constituents, and organizations in a database. Buttons appear on many pages in the system and they transfer directly from the page to another within the same administrative function to generate or review a communication, a checklist, or a comment for the individual or organization whose information is being currently viewed. 

Campus 
 A campus is used to indicate where the courses are scheduled. 

Career 
 Undergraduate, graduate, profession, military 

Catalog Number 
 A unique number that is tied to a specific subject (course). 

Checklist 
 Review or create checklists for an individual or organization. Checklists may be lists of steps that must be performed, or documents that must be provided, or communications that are planned to occur. Used to track applications, organize recruitment mailings, and generate communication items for students. 

Checklist Item 
 An object or task that represents one of the entries on a list of documents to compile or jobs to be done. 

Class 
 A specific offering of a course in a semester. A class may have several components: lecture, lab, or tutorial. 

Class Associations 
 How groups of classes are set up to ensure the appropriate related classes of the same course are presented to students during the enrollment process. 



Class Number 
 A unique number assigned to each class (or section) in a term; used for enrollment purposes. 

Class Roster 
 A list of students enrolled in a class. 

Class Schedule 
 Provides class scheduling information by week or term. 

Comment 
 Review or enter comments about an individual or organization. 


Comment Category 
 The link between a specific comments and an administrative function. It determines who has access to certain comments. 

Communications Record 
 Review or create communications for an individual or organization. Provides a record of letters, phone calls, meetings, emails, and faxes. 

Component 
 Identifies the different structure of a course (i.e., lecture, lab, seminar, or tutorial). 



Course Attributes 
 Associated to courses or specific class sections and are generally used for reporting purposes 

Course Catalog 
 A list of all courses that are or have been offered at each campus, with descriptions and all other course details. 

Course ID 
 Master course identification number automatically assigned by the system. Course IDs always remain with the course, even if the course is renumbered. 

Course Offering Number 
 A system generated number to indicate which offering the course data represents. 

Credit History 
 Ages unpaid services not satisfied on a student’s account. 

Dynamic Class Dates 
 Classes that begin and end at various times throughout a session will have cancel, withdrawal, drop, and other default dates calculated. 

Effective Date 
 The date on which a value, description, or record becomes current. Depending on the type of information, the current record is based on the current date or the Term Begin Date/Last Term Activate dated defined for a term. 

Effective Dating 
 Allows the tracking of changes over time by recording the date each change becomes effective. This allows for the entry of future-dated changes, and the ability to view changes to a record over time. 

Enrollment Appointment 
 Date and time when a student or group of students can begin registering in the courses for a term. 

Enrollment Component 
 When scheduling a course that requires more than one component, all sections associated to one component type will be defines as the “enrollment” component and any other components will be considered the ”non-enrollment” component. 

Enrollment Engine 
 A PeopleSoft delivered process which evaluates registration requests and performs a number of checks before registering a student into one or more classes. This check includes things such as time conflicts, maximum unit load, class requisites, and reserve capacities. 

Enrollment Letter 
 Letter confirming a student’s registration. 

Enrollment Request 
 An attempt to enroll or register in a particular class. 

Enrollment Requirement Group 
 A set of rules that is associated to one or more courses and/or classes and specifies the requirements that a student must meet in order to register. The rule can specify things such as a student’s career, program and plan, academic level, etc. 

Expected Graduate Term 
 The term the student expects to graduate. 

Faculty Center 
 Self-service component where faculty manage class, student, and advisee related activities. 

Grade Roster 
 The printed form used for grading collection or online screen that is used to enter grades into the system.




Graded Component 
 Every course has to have a graded component. Classes which are assigned the graded component will have grade rosters generated for them at the end of the term in preparation for grade entry. 

IF Statement 
 Type of merge filed that displays one of two options, depending on the criteria set in the statement. 

Instruction Mode 
 How a class is taught (i.e., in person, online, distance education, independent study, etc.) 

Legacy
 Commonly used to refer to the old SIS+ system that PeopleSoft is replacing.

Letter Generation 
 A PeopleSoft delivered multi-step process that generates a mail merge file based on previously assigned communications. The resulting file can then be used in Word to create merged emails or letters. 

Location 
 Has two meanings depending on where it is being referenced. 
Timetabling – Locations are used to provide more detail regarding where a class is offered. 
External Organizations – Locations are used to track one or more addresses for an external organization for mailing or contact information. 



Matriculation 
 The process which automatically creates a student record for applicants who have accepted an offer of admission, have been admitted, and have paid their registration deposit. Matriculation enables the student to be term activated and then proceed with registration. 

Metadata 
 Data about data. In student reporting, properties and options pertaining to particular database content or other resources. The Metadata report describes the kinds of information available. 

Milestones 
 Designed to record and track important requirements that must be completed by a student during their program of study. Milestones are non-course requirements and may appear on the transcript. Milestones are used when credit is not given, but when it is necessary to record the completion, such as foreign language exemption, math placement, or teacher certification. 

NSI
 Negative service indicator

Person Record 
 Data in PeopleSoft that uniquely identifies a person. Includes information that identifies a person, such as: name, birth date, citizenship, gender, ethnicity, address, and telephone number. Each person only has one person record in PeopleSoft. 

Planner 
 A registration preparation option. The student can add classes to their Planner and add them to their schedule once their enrollment appointment opens. 

Positive Service Indicator 
 Indicated that special services are required (i.e., additional manual processing needs to be done on a student file). 

Post Value 
 The status of a record in the Suspense File that has been considered for entry in the database. The possible values are Complete, Error, and Perform. If a record examined during the Search/Match process contained no errors (missing or invalid values) and was not a duplicate, or possible duplicate, of an existing record, it would be added to the database and it Post Value would be Complete. If the Search/Match process found errors or possible duplicates, the Post Value would be Error. 





Program Action 
 The actions taken on an application. The action being done to the student record to record the progression of either an application (admit, admit revocation, conditional admit, defer decision, etc.) or student program (i.e., active, suspended, discontinued, plan change, etc.) 

Program Status 
 A calculated value based upon the series of program actions that have occurred in either the application for admission or the student program record. The program status is used to determine if a student is still “active” in the application/student program. 

Prospect 
 An individual that has expressed interest in attending the University or College; or an individual the University or College is interested in. 

PSI
 Positive service indicator

Purge Process 
 A set of steps the system executes to remove values from tables in the database. 

Repeat Checking 
 Process for enforcing the institution’s course repeat policy at the time of course enrollment and for processing information about a repeated course at the time that grades are posted; also occurs at the time transfer credit is recorded. 

Requisites 
 Course restrictions, pre-requisites, co-requisites, and anti-requisites. 

Report 
 A printable version of results which have been read and returned from a database. 

Reserve capacities 
 Blocks of seats reserved for specific groups of students for specific periods of time. 

Run Control ID 
 The name a user gives to a set of parameters defined to run a process. 



Search/Match 
 A feature that enables you to search for and identify duplicated records in the database. 
Used to identify records in the database that match the criteria specified when adding a person or organization into the system. 

Service Impact 
 The resulting action triggered by a service indicator. For example, a service indicator that reflects nonpayment of account balances by a student might result in a service impact that prohibits registration for classes. 

Service Indicator 
 Negative – an indicator on the system that restricts student access to one or more services (i.e.; enrolling in classes, requesting transcripts, etc.) and is easily visible to staff. 
Positive – indicates that special services are required (i.e.; additional manual processing needs to be done on the student’s file).



Service Impact 
 An action triggered by a Service Indicator. For example, a Service Indicator that reflects non-payment of account balances by a student may result in a Service Impact that prohibits registration for classes. 

Session 
 A period of time within or outside a term in which classes are offered. 

Set Letter Code 
 An identifier for the group of letter codes to which as particular letter code belongs. 

SI
 Service Indicator

Standard Letter Code 
 An identifier for a particular outgoing document or publication. 

Student Agreement 
 Agreement between a student’s major college and student with regard to transfer credit. 

Student Appointment Block 
 Groups of students assigned enrollment appointments (e.g; freshman, transfer); determines how each group of students is ranked such as GPA, number of units, and level. 

Student Career Number 
 A unique number that identifies each set of Program/Plan/Subplan information in which a student is admitted into and graduates from. 

Student Center 
 A self-service component where students manage their school-related activities. 

Student Record 
 A historical account of a student’s record. 



Student Response 
 Captures the reason why an applicant chose to attend another institution and what institution he/she will be attending. This can be manually entered, or if a student declines the admissions offer via self-service, the student is automatically promoted to tell us why he/she is going to attend another institution and which one. 

Subject/Subject Area 
 Topic area of a course (e.g., BIOL). 

Suspense File 
 A temporary table to which test score records are loaded for review and, if necessary, cleanup before being posted to the database. 

Term Short Description 
 The coding scheme for year and semester. 

Tracking Group 
 A combination of one or more related checklists into a single unit for ease of monitoring their progress toward completion. 

Transcript Data Medium 
 The method of receiving transcripts. 

Transcript Data Source 
 The source of the transcript. 

Transcript Date 
 The date the transcript was produced by the school. Will often appear on a transcript as the transcript printed date, run date, or issued date. 

Transcript Received Date 
 This date will populate the current date when the received checkbox is selected. 

Transcript Status 
 The status of the transcript received. Final or In Progress. 

Transfer To 
 A functionality that the system provides to act as a quick jump key from functional pages and is provided as a drop down menu. It allows the user to bypass long navigation and quickly access the designated panels normally called for from the respective functional page.

Term 
 Describes a period of time in which classes are scheduled and students register and statistics are calculated. 

Term Activation 
 Creation of a term record for a student which then enables them to register in the activated term(s) when registration opens. 

Term Roll 
 The process of copying a previous year’s term forward providing a starting point for the scheduling of a new term. 

Term Short Description 
 The coding scheme for year and semester. 



Units 
 Credit Hours. Identifies the amount of credit that applies to the course. 

Update Access 
 A type of security access that permits the user to edit and update data. 

Variable Data 
 The information that links a specific communication to a person in the database, using key data from the person’s record. 

Visa/Permit Data 
 This link from Biographical Details is where you may enter or review an individual’s visa and permit data, including country type, date of issue, duration, issuing authority, and other visa/permit information. 

Wait List 
 A process that allows students to remain on a list for possible entry into a course that is full. 



Thursday, March 29, 2012

DuplicateRowCheck


Function DuplicateRowCheck();
     Local Rowset &rsLNRow1,&rsSerialrset1;
         Local number &k, &L,&SEQ1;
         Local string &M, &P;
         &rsLNRow1 = GetLevel0()(1).GetRowset(Scroll.RMA_LINE);    
         For &SEQ1 = 1 To &rsLNRow1.ActiveRowCount
            &rsSerialrset1 = &rsLNRow1.GetRow(&SEQ1).GetRowset(Scroll.RMA_SERIAL_LOT);         
            For &k = 1 To &rsSerialrset1.ActiveRowCount              
               &M =&rsSerialrset1.GetRow(&k).RMA_SERIAL_LOT.SERIAL_ID.Value;              
               For &L = &k + 1 To &rsSerialrset1.ActiveRowCount                 
                 &P = &rsSerialrset1.GetRow(&L).RMA_SERIAL_LOT.SERIAL_ID.Value;
                  If &M = &P Then
                    Error MsgGet(100000, 0, "Duplicate Serial_id in Rownumbers:[ " | &M | " ] and [ " | &P | " ] ");
                  End-If;             
               End-For;             
            End-For;          
         End-For;   
 End-Function;

firstdaythismonth, lastdaythismonth, firstdayprevmonth, lastdayprevmonth,days_of_prevmonth

DAYS_OF_PREVMONTH

SELECT Trunc(SYSDATE, 'MM')                            firstdaythismonth,
       Last_day(Trunc(SYSDATE))                        lastdaythismonth,
       Trunc(Trunc(SYSDATE, 'MM') - 1, 'MM')           firstdayprevmonth,
       Last_day(Trunc(Trunc(SYSDATE, 'MM') - 1, 'MM')) lastdayprevmonth,
       Extract(DAY FROM Last_day(Trunc(Trunc(SYSDATE, 'MM') - 1, 'MM')))
                                                       days_of_prevmonth
FROM   dual; 

LeapYear SQL


SELECT CASE
         WHEN (SELECT Extract(DAY FROM Last_day(To_date('0201'
                                                        ||Extract(YEAR FROM
                                                                  SYSDATE),
                                                       'mmddyyyy')))
               FROM   dual) = '29' THEN 'LeapYear'
         ELSE 'Not A Leap Year'
       END
FROM   dual 

Monday, March 26, 2012

PeopleSoft Help: Function IsLeapYearFunction IsLeapYear(&iYear As ...

PeopleSoft Help: Function IsLeapYear
Function IsLeapYear(&iYear As ...
: Function IsLeapYear Function IsLeapYear(&iYear As number) If (&iYear Mod 4 = 0) And ((&iYear Mod 100 <> 0) Or (&iYear Mod 400 = 0)) Then ...
Function IsLeapYear

Function IsLeapYear(&iYear As number)
If (&iYear Mod 4 = 0) And ((&iYear Mod 100 <> 0) Or (&iYear Mod 400 = 0)) Then
&IsLeapYear Value= True;
Else
&IsLeapYearValue = False;
End-If;
End Function;
PRINT BUTTON PeopleCode
<HTML
<FORM>
<INPUT TYPE="SUBMIT" NAME="Print Button"  value="Print Button"
style="background-color:#FFFF00;"
title="PRINT" onclik=' ' onMouseOver="this.style.background ='#00FF00'"
onMouseOut="this.style.background='#FFFF00'"onClick="window.print()">
</FORM>
</HTML>
<div id="buttons">
<input type="button" class="search-btn" value=" Print "
onclick="javascript:window.print()" />
<input type="button" value=" Close" onclick="javascript:window.close()" />
</div>
HTML code fro Print Button
(Button Color, On mouse Color change  for PeopleSoft Pages ).

<html>
<form action="">
<input type="button" value="Hello world!" style="background-color:#FFFF00;"
title="PRINT" onclik=' ' onMouseOver="this.style.background ='#00FF00'"
onMouseOut="this.style.background='#FFFF00'" onClick="window.print()">
</form>
</body>
</html>

Find Decimal Position in Number

Function DecimalPos(&sNumberStr) Returns number
   Local number &nReturn;
   If All(&sNumberStr) Then
      Return Round(Value(&sNumberStr / 100), 2)
   Else
      Return 0;
   End-If;
End-Function;
MakeDateFromString


Function MakeDateFromString(&sDate) Returns date
   Local date &dtRetDt, &dtNull;
   Local number &nMonth, &nDay, &nYear;
   If All(&sDate) And
         &sDate <> "00000000" Then
      &nMonth = Value(Substring(&sDate, 5, 2));
      &nDay = Value(Substring(&sDate, 7, 2));
      &nYear = Value(Substring(&sDate, 1, 4));
      rem &fileBatch.WriteLine("&nMonth: " | &nMonth | "&nDay: " | &nDay | "&nYear: " | &nYear);
      Return Date3(&nYear, &nMonth, &nDay);
   Else
      Return &dtNull;
   End-If;
End-Function;
DeleteFile Function

Function DeleteFile(&FilePath As string, &sFileName As string) Returns string;
   Local string &sReturnValue;
   Local File &RQST_FILE1 = GetFile(&FilePath | &sFileName, "W", %FilePath_Absolute);
   Local number &retcode;
   Local JavaObject &oDelFile;
   &FNAMES = FindFiles(&FilePath | &sFileName, %FilePath_Absolute);
   If &FNAMES.Len > 0 Then
      MessageBox(0, "", 0, 0, "fileExists " | &FNAMES [1]);
      If All(&RQST_FILE1) Then
         &oDelFile = CreateJavaObject("java.io.File", &FilePath | &sFileName);
         &sFileName1 = &oDelFile.getName();
         &nFilelength1 = &oDelFile.length();
         MessageBox(0, "", 0, 0, "&sFileName1  " | &sFileName1);
         MessageBox(0, "", 0, 0, "&nFilelength1  " | &nFilelength1);
         &oDelFile.delete();
         Return "DELETED";
      End-If;
   End-If;
   Return " ";
End-Function;

PeopleSoft Help: Send Mail WithAttachmentsFunction SendMCFMailWith...

PeopleSoft Help: Send Mail WithAttachments
Function SendMCFMailWith...
: Send Mail WithAttachments Function SendMCFMailWithAttach(&sFrom As string, &sSubject As string, &sEmail_BODY As string, &sMAIL_FILES As str...
Send Mail WithAttachments

Function SendMCFMailWithAttach(&sFrom As string, &sSubject As string, &sEmail_BODY As string, &sMAIL_FILES As string, &sFileName As string) Returns number
   Local PT_MCF_MAIL:MCFMultipart &multipartobj = create PT_MCF_MAIL:MCFMultipart();
   Local PT_MCF_MAIL:MCFOutboundEmail &sendmailobj = create PT_MCF_MAIL:MCFOutboundEmail();
   Local PT_MCF_MAIL:MCFBodyPart &htmlpart = create PT_MCF_MAIL:MCFBodyPart();
   Local integer &sendstatus;
   SQLExec("SELECT  EMAILID FROM PSUSEREMAIL  a  where OPRID=:1 and EMAILTYPE='BUS' and PRIMARY_EMAIL='Y'", %UserId, &sEMAILID);
   If All(&sEMAILID) Then
   Else
      &Email_Ids = &sEMAILID; /*Default Emaild*/
   End-If;
   If All(&sFrom) Then
      &sendmailobj.From = &sFrom;
   End-If;
   &sendmailobj.Subject = &sSubject;
   &sendmailobj.Recipients = &sEMAILID;
   &htmlpart.Text = &sEmail_BODY;
   &htmlpart.ContentType = "text/html";
   If All(&sMAIL_FILES) Then
      &htmlpart.AttachmentURL = &sMAIL_FILES;
      &htmlpart.FileName = &sFileName;
      &htmlpart.FilePathType = %FilePath_Absolute;
   End-If;
   &multipartobj.AddBodyPart(&htmlpart);
   &sendmailobj.MultiPart = &multipartobj;
   &sendmailobj.ContentType = "text/html";
   If All(&sEMAILID) Then
      &sendstatus = &sendmailobj.Send();
   Else
      MessageBox(0, "", 0, 0, "*** NO USER NOTIFICATION SETUP ***");
   End-If;
   Return &sendstatus;
End-Function;

Send Email From ProcessScheduler Processes


Function SendEmailFromProcessScheduler(&ProcessType As string, &ProcessName As string, &sEmailSubject As string, &sEmailBody As string)
   Local SQL &Email_ID_SQL;
   Local string &EmaiId, &Email_Ids;
   &Email_Ids = "";
   &Email_ID_SQL = CreateSQL("SELECT A.EMAILID FROM PSUSEREMAIL A, PS_PRCSDEFNNOTIFY B WHERE A.OPRID = B.DISTID AND B.PRCSTYPE =:1 AND B.PRCSNAME = :2 AND B.DISTIDTYPE = '2' AND A.EMAILTYPE = 'BUS' union SELECT A.EMAILID FROM PSUSEREMAIL A, PS_PRCSDEFNNOTIFY B, PS_ROLEUSER_VW C WHERE A.OPRID = C.ROLEUSER AND C.ROLENAME = B.DISTID AND B.PRCSTYPE =:1 AND B.PRCSNAME = :2 AND B.DISTIDTYPE = '3' AND A.EMAILTYPE = 'BUS' ", (&ProcessType, &ProcessName);
   While &Email_ID_SQL.Fetch(&EmaiId)
      If &Email_Ids = "" Then
         &Email_Ids = &EmaiId
      Else
         &Email_Ids = &Email_Ids | ";" | &EmaiId
      End-If
   End-While;
   &Email_ID_SQL.Close();
   &nFlag = 0;
  
   &strCC = "";
   &strBCC = "";
   If All(&Email_Ids) Then
      SendMail(&nFlag, &Email_Ids, &strCC, &strBCC, &sEmailSubject, &sEmailBody);
   Else
      MessageBox(0, "", 0, 0, "*** NO USER NOTIFICATION SETUP ***");
   End-If;
End-Function;

Tuesday, March 20, 2012

Rename File in Unix through PeopleCode

                                             Rename File in Unix through PeopleCode

Exec("mv <path>/file1.csv <path>/file2.csv", %Exec_Asynchronous + %FilePath_Absolute);

How to zip files through peoplecode

                               How to zip files through peoplecode
Exec("gzip -c <path>/file.txt > <path>/file.gz", %Exec_Asynchronous + %FilePath_Absolute);
Exec("gunzip -c <path>/file.gz >", %Exec_Asynchronous + %FilePath_Absolute);
gzip -c file.txt > file.gz
http://examplenow.com/gzip/
gzip [-acdfhlLnNqrtvV19] [-S suffix] [file ...]
gunzip [-acfhlLnNqrtvV] [-S suffix] [file ...]
gzcat -fhLV [file ...]
http://www.mkssoftware.com/docs/man1/gzip.1.asp

Monday, March 19, 2012

Base64 Encoding, Decoding


Base64 Encoding, Decoding

SCC_COMMON_UTILITIES.UTIL.Base64Wrapper.OnExecute
 (This Appl package has all the methods needed for base64 encode and decode)

class Base64Wrapper
   method Base64Wrapper();
   method encode(&filename As string) Returns string;
   method decode(&filename As string, &base64data As string) Returns boolean;
   rem method getErrorDetails() Returns string;
private
   instance JavaObject &joB64;
end-class;
method base64Encode
   Local number &nbr_retcode;
   Local File &file;
      &nbr_retcode = GetAttachment(&fileURL, &sysfilename, &tempFilename);
   %This.delay();
   If &nbr_retcode > 0 Then
      throw CreateException(18179, 207, "", &displayFilename);
   End-If;
   &Base64String = &b64w.encode(&tempFilename);
   %This.cleanupTempFile();
   end-method;;
method Base64Wrapper
   rem &joB64 = CreateJavaObject("com.peoplesoft.hrms.hrs.base64Utils");
   &joB64 = CreateJavaObject("com.peoplesoft.hr.sa.base64Utils");
end-method;
method encode
   /+ &filename as String +/
   /+ Returns String +/ 
   Local string &filedata;
   &filedata = &joB64.base64Encode(&filename);
   Return &filedata;
end-method;
method decode
   /+ &filename as String, +/
   /+ &base64data as String +/
   /+ Returns Boolean +/
   Return &joB64.base64Decode(&filename, &base64data);
   end-method;
/*method getErrorDetails
   /+ Returns String +/
   Return &joB64.getErrorDetails();
end-method;*/
HRS_HROI_RESUMEEXTRACT:Util(Application Package)
HRS_HROI:UTIL:Base64Wrapper;
class Base64Wrapper
   method Base64Wrapper();
   method encode(&filename As string) Returns string;
   method decode(&filename As string, &base64data As string) Returns boolean;
private
   instance JavaObject &joB64;
end-class;
method Base64Wrapper
   &joB64 = CreateJavaObject("com.peoplesoft.hrms.hrs.base64Utils");
end-method;
method encode
   /+ &filename as String +/
   /+ Returns String +/
      Local string &filedata; 
      &filedata = &joB64.base64Encode(&filename);
   Return &filedata;
end-method;
method decode
   /+ &filename as String, +/
   /+ &base64data as String +/
   /+ Returns Boolean +/
   Return &joB64.base64Decode(&filename, &base64data);
   end-method;;