Translate

Tuesday, 29 January 2013

How to go main page from secondary page using DoModal and EndModal functions

  • Insert bushbutton in main page destination :peoplecode,record :recname, fieldname: fldname(ex:code)
    write peoplecode domodal code in  code field fieldchange event
  • DoModal(Page.SP_SEC_PNL, "SAMPLE 2NDARY PAGE ", 111, 111);
  • Domodal:Use the DoModal function to display a secondary page. Secondary pages are modal, meaning that the user must dismiss the secondary page before continuing work in the page from which the secondary page was called.
     Note:Domodel can display only single page. to display entire component use DoModelcomponent.
  • In secondary page if you dont have any ok or cancel button use push button in secondary page write code Endmodal (1) in field change event.
     


EndModal(returnvalue):

Use the EndModal function to close a currently open secondary page. It is required only for secondary pages
that do not have OK and Cancel buttons. If the secondary page has OK and Cancel buttons, then the function
for exiting the page is built in and no PeopleCode is required.

The following statement acts as an OK button:.
EndModal(1);
The following statement acts as a Cancel button:
EndModal(0);

Monday, 28 January 2013

Changing default SETID for a business unit

First up, how to associate a SETID with a Business Unit in PeopleSoft?
It's a one time activity done while creating a Business Unit. However SETIDs cannot be changed as easily as one would think after the creation of a Business Unit

Business Units(BU) are created and maintained in the navigation: Set Up HRMS -> Foundation Tables -> Organization -> Business Unit

In this BU page, under 'Default Record Group Setids' either a new SETID can be entered or SETIDs setup can be cloned from an existing Business Unit.











Until an option is chosen, only one field is editable and other is disabled. If the cursor is positioned to 'SETID' then 'Clone from Existing Business Unit' is disabled and vice-versa.
Once an option is chosen and saved, both the options get grayed out and one cannot modify this default SETID. So how to change the SETIDs once a Business Unit is setup and associated with a different SETID?

There are two ways to change the SETIDs for a Business Unit:
1) Conventional - PIA method:
Navigate to PeopleTools -> Utilities -> Administration -> TableSet Control
Type in the setcontrol value in the search page.
Change the default setid to a required new SETID. Doing this would associate the new SETID for all the Record groups for that BU. If you need to change the SETID only for a few Record Groups then change the setids for each record group instead of changing the default SETID.


2) Backend(database update) method:
Default setid in the below table's has to be updated to replace the PeopleSoft delivered default setid.

  • PS_SET_CNTRL_TBL
  • PS_SET_CNTRL_GROUP
  • PS_SET_CNTRL_REC
  • and the Record group table
Record group table can be PS_REG_REGION_TBL, PS_LOCATION_TBL, PS_DEPT_TBL and so on. If you need to change the SETID for a Region from 'ABC' to 'XYZ' then update the above three tables and PS_REG_REGION_TBL.

Friday, 25 January 2013

Dosave V/S Dosave now

Dosave() : Use the DoSave function to save the current page. DoSave defers processing to the end of the current
PeopleCode program event, as distinct from DoSaveNow, which causes save processing (including SaveEdit,
SavePreChange, SavePostChange, and Workflow PeopleCode) to be executed immediately.


DoSave can be used only in FieldEdit, FieldChange, or MenuItemSelected PeopleCode.

The following example sets up a key list with AddKeyListItem, saves the current page, and then transfers the
user to a page named PAGE_2.
ClearKeyListItem( );
AddKeyListItem(OPRID, OPRID);
AddKeyListItem(REQUEST_ID, REQUEST_ID);
SetNextPage("PAGE_2");
DoSave( );
TransferPage( );

Dosavenow():DoSaveNow causes the current page to be saved immediately. Save processing (including SaveEdit,SavePreChange, SavePostChange, and Workflow PeopleCode) is executed before continuing execution of the program where DoSaveNow is called. DoSaveNow differs from the DoSave function in that DoSave defers saving the component until after any running PeopleCode is completed.

DoSaveNow can only be called from a FieldEdit or FieldChange event

The following example calls DoSaveNow to save the component prior to running a remote process in the
remote_depletion declared function:
Declare Function remote_depletion PeopleCode FUNCLIB_ININTFC.RUN_DEPLETION Field⇒
Formula;
/*
Express Issue Page - run Depletion job through RemoteCall()
*/
If %Component = COMPONENT.EXPRESS_ISSUE_INV Then
DoSaveNow();
&BUSINESS_UNIT = FetchValue(SHIP_HDR_INV.BUSINESS_UNIT, 1);
&SHIP_OPTION = "S";
&SHIP_ID = FetchValue(SHIP_HDR_INV.SHIP_ID, 1);
remote_depletion(&BUSINESS_UNIT, &SHIP_OPTION, &SHIP_ID, &PROGRAM_STATUS);
End-If

how to send mail using peoplecode

It is not possible to send HTML embedded emails using PeopleSoft standard Workflow Technologies. However it is possible to send HTML embedded emails using SENDMAIL function.

All About SENDMAIL function:
Below is what is specified in PeopleBooks on SENDMAIL function. After the end of the transcript on SENDMAIL function.

Example
The following example sets up several variables that are then used to construct an email message that
includes two attachments:
&MAIL_FLAGS = 0;
&MAIL_TO = "jagruthi@peoplesoft.com;surya@peoplesoft.com";
&MAIL_CC = "";
&MAIL_BCC = "mom@aol.com";
&MAIL_SUBJECT = "Live long and prosper!";
&MAIL_TEXT = "Please read my attached CV. You will be amazed and hire me⇒
forthwith.";
&MAIL_FILES = "c:\mydocs\resume.doc;c:\mydocs\coverlet.doc";
&MAIL_TITLES = "My CV;READ ME";
&MAIL_SENDER = "MyEmail@Yahoo.com";
&RET = SendMail(&MAIL_FLAGS, &MAIL_TO, &MAIL_CC, &MAIL_BCC, &MAIL_SUBJECT, &MAIL_⇒
TEXT, &MAIL_FILES, &MAIL_TITLES, &MAIL_SENDER);
if not (&RET = 0) then
WinMessage("Return status from mail = " | &RET);
end-if;

Thursday, 24 January 2013

How to Disable a PeopleSoft Workflow Event?

Method#1 - The Application Designer Way:
In Application designer, we can Open and turn off the Active check box for each Activity, in event definition
 .

Method#2 - The PIA way:
Navigate to PeopleTools -> Workflow -> Defaults and Messages -> Set Workflow Defaults
Then uncheck the worklist and email boxes. However, this will disable all the workflows rather than just one particular event or required event(s). 

people soft workflow how to track a ps notifications (emails)

PeopleSoft has a record named PS_PT_WF_NOTFY_TBL which keeps track of the user (CREATEDOPRID) who triggered the notificaiton, the time (CREATEDTTM) of the notification and To, Cc, Bcc details, Email Subject, Email Body.

However PS_PT_WF_NOTFY record is used only for notification functionalities and not the standard workflow
Notification functionality is writted in the application package PT_WF_NOTIFICATION:Notification. This App Package has a method InsertNotificationRecord which inserts the notification details in PS_PT_WF_NOTFY table.

This record can be used to track emails sent using Send Notification functionality. The only way I know to track PeopleSoft standard workflows that get triggered through TriggerBusinessEvent function is to check the smtp.log file.

To track emails, first we could check this record with a query as simple as the below:
SELECT * FROM PS_PT_WF_NOTFY_TBL ORDER BY CREATEDTTM DESC;
If we could not get any information in this record chances are that the workflow which got triggered was not making use of the Send Notifcation functionality.  

Wednesday, 9 January 2013

Creating Database level Audit records in Peoplesoft

As we all aware, creating application level audit is just adding 3 extra fields in the audit record and placing it in main record properties.

But creating Database level audit is slightly different from it.

Please follow the below steps to do it.

1. Similar to application level audit, create a new record with addition fields AUDIT_OPRID, AUDIT_STAMP and  AUDIT_ACTN.
2. Create triggers based on your required operations like add, change and delete.
3. Run the trigger SQL script in the database.

How to create triggers:
If you are good in writing SQL in various database platforms, then you can write trigger code by your own.
if you are not familier with SQL on how to create triggers, then you can use the delivered functionality to generate the script in the following location.














Enter into the component using the main record on which you want to create the audit.
After entering into the component, Enter the audit record which was created and select the options based on your requirement.












Click on Generate code button, it will generate the script based on the type of database you use.
now save the component.

Execute Trigger Script in Database:
Now go to Perform Database level Audit component which is also in the same navigation to execute the script generated, in your database.

If you want to see the script, you can get it in process log files of that process.

How to insert null value into date field in peoplesoft using SQLEXEC

If we build a record in peoplesoft App designer, other than date fields, all other fields will be 'not null' fields in database. only date columns will be null fields.
But if we want to insert a null value using SQLEXEC as below.
&name='Samba';
&birthdate=null;    /* or &birthdate=' '; */
SQLexec("INSERT INTO TABLE VALUES(:1,:2)",&name,&birthdate);
Result in Database will be as below:
Name        Birthdate
Samba      01/01/1900
Thought we inserted a null value or space (' '), it has taken 01/01/1900 into the date field.
To avoid the above situation, we can try this.
&name='Samba';
&birthdate=Date(0);
SQLexec("INSERT INTO TABLE VALUES(:1,:2)",&name,&birthdate);
now the output will be
Name        Birthdate
Samba        Null
So Date(0) can be used to insert null value into date fields.Hope this will be useful.

Tuesday, 8 January 2013

PeopleSoft Audit record for multiple tables

Manageability
Field level auditing is manageable when you are interested in auditing one or two fields. Beyond that the complexity increases drastically. That’s certainly not the case with Record level auditing where you can easily manage entire records.
Situation
Based on the factors outlines above, it would be wise to choose Record level auditing when the situation demands the auditing of a number of fields or a record as a whole. However, you always have another option in Field level audit when you are chasing just a filed or two.


Is it possible to have one single audit record for multiple PeopleSoft records(tables)?
Yes, today I came to know a feature that a single audit record can be used to audit multiple PeopleSoft records. As I write about this, I have also specified all about a PeopleSoft Audit record.

The easiest way to create an audit record is to open the record definition of the base record that you wish to audit. Remove the all edit and key attributes from the newly saved audit record. Also remove any attributes such as PARENT records, Query Security Records, and PeopleCode must be removed for the audit record. The audit record must be saved with the prefix AUDIT_.

To the top of this new audit record the following key fields have to be added in the same order and they should also be made as key fields.

  • AUDIT_OPRID
  • AUDIT_STAMP
  • AUDIT_ACTN
  • AUDIT_RECNAME**
In most cases we include only AUDIT_OPRID, AUDIT_STAMP, and AUDIT_ACTN. The AUDIT_STAMP must be given the attribute AUTOUPDATE attribute must be checked for the field AUDIT_STAMP. AUDIT_STAMP field must also be made a descending key field.
  • AUDIT_OPRID - Identifies the user who caused the system to trigger the audits
  • AUDIT_STAMP -Identifies the date and time the audit was triggered 
  • AUDIT_ACTN - Indicates the type of action that the system audited.
         Possible audit actions include:
    • A: Row inserted. 
    • D: Row deleted.
    • C: Row changed (updated), but no key fields changed. The system writes old values to the audit table.
    • K: Row changed (updated), and at least one key field changed. The system writes old values to the audit table.
    • N: Row changed (updated), and at least one key field changed. The system writes new values to the audit table.

** - AUDIT_RECNAME must be added only if the audit table needs to audit more than one record definition.


The audit table need not have to include all the columns of the base table. In fact, for performance reasons, it’s best to only to include those fields in the audit record that are deemed to be changed.


In the record to be audited go to Record Properties -> Record Audit, specify the below options

Record Name – Specify the user-defined audit record.

Specify the required Audit Options – following are the audit options to choose for auditing the record.
  • Add - Inserts an audit table row whenever a new row is added to the table underlying this record definition.
  • Change - Inserts one or two audit table rows whenever a row is changed on the table underlying this record definition.
  • Selective - Inserts one or two audit table rows whenever a field that is also included in the record definition for the audit table is changed.
  • Delete - Inserts an audit table row whenever a row is deleted from the table underlying this record definition.

Everytime the record is being inserted, deleted, updated a corresponding row gets inserted in the audit table as per the options specified.

Monday, 7 January 2013

How to run XML Publisher(XMLP) processes to generate PDF paychecks in PeopleSoft HCM 9.0 and above

Below are the steps briefing on how to run the PeopleSoft delivered XMLP processes for NA Payroll to generate *.PDF paychecks.



Payroll for North America provides user to select from two methods of printing checks and advices:
  • Printing by SQR Reports (PAY003, PAY003CN, DDP003, and DDP003CN). The Check Print and Cheque Print SQR reports (PAY003 and PAY003CN) and the Direct Deposit Advice Print SQR reports (DDP003 and DDP003CN) extract the payroll data for check and advice printing and format it for printing checks and advices.
  • Printing in PDF by RTF Templates using XML Publisher (PYCHKUSA, PYCHQCAN, PYDDAUSA, and PYDDACAN). These PSJob processes prepare the check and advice report files:
      • Print US Checks PSJob process (PYCHKUSA).
      • Print Canadian Cheques PSJob process (PYCHQCAN).
      • Print US Direct Deposit Advice PSJob process (PYDDAUSA).
      • Print Canadian Direct Deposit Advice PSJob process (PYDDACAN).
This post deals about the second method of generating PDF paychecks using XML Publisher. Click here to find out the initial setup required and how to configure XMLP processes for NA Payroll.

How to run XMLP Process to generate PDF Paychecks and Direct Deposit Advice?
  1. Instead of the usual ‘Print Paycheck’, run Create PDF Paychecks from the navigation: Payroll for North America > Payroll Processing USA Produce Checks > Create PDF Paychecks > Create PDF Paychecks; or Payroll for North America > Payroll Processing CAN > Produce Cheques > Create PDF Paycheques > Create PDF Paycheques. For Direct Depost Advice the navigation and the process names would change.
  2. Enter the pay run id and the other required values
  3. Days From Check Date: Leave this field blank to retain the default value entered on the Paycheck Options Table page. To override the value on the Paycheck Options Table for this check or advice print run, enter a different number of days from check date. The system issues a confirmation message if you enter an override. If you do not confirm the override, the system does not save the value you entered and the field remains blank.
  4. Click 'Run'
  5. On the Process Request page, select the type Web and the format PDF.


Paychecks can be viewed by employees under self service. For administrator to view all the PDF checks or advice forms run through XMLP, must use the Report Manager to view the PDF print files.

How/Where to view the Paychecks created by XMLP process?
  1. Access the Report Manager.
  2. To locate and open the PDF file use one of these methods(whichever is available):
    • From the Report Manager - List page.
      • Click the XMLP link in the Report column for the selected batch file.
    • From the Report Manager - Administration page.
      • Click the Details link for the selected batch file.
  3. The system displays another page, where you click the *.pdf file link to access the PDF report in Adobe Acrobat. Depending upon the bursting option chosen, paycheck files would be bursted accordingly. Bursting options can be set under the navigation:

Setting up Self Service PDF Check in PeopleSoft HRMS 9.0 and above

Below are the list of steps to configure XML Publisher for printing PDF paychecks in PeopleSoft HRMS 9.0 and 9.1
 

1) Navigate to Setup HRMS > Product Related > Payroll for North American > Payroll Processing Controls > Paycheck Options Table

2) Enter a paycheck setup id:
Setup ID and Parameters:

Paycheck Setup ID

Use one of the delivered setup IDs:
    *     PNAUSA: Use this setup ID for the United States.
    *     PNACAN: Use this setup ID for Canada.
 Payroll for North America does not provide support for user-defined setup IDs     

3) Enter the following parameters
    URL Identifier
    Payroll for North America delivers the Paycheck Options table with PY_SSP_ATTACHMENT table with associated URL address for storing the XML self-service paycheck data. If you create a separate table and URL to store the data, enter your URL here.

Report Definition:
Printing:
Displays the current active report definitions for printing U.S. and Canadian paychecks and direct deposit advices.

Viewing: 
Displays the current active report definitions for displaying self-service U.S. and Canadian paychecks and direct deposit advices in the ePay application.

Self Service Options:
PDF Paychecks Only:
If your organization used the View Paycheck transaction before Payroll for North America 9.0, use this option to indicate whether you want employees to be able to view older paychecks as well as the PDF paychecks.  Select this option to enable employees to view only the PDF self-service paychecks. Leave this option blank to enable employees to view all self-service paychecks.

$0 or Negative Manual Checks:
Select this check box if you want the system to display manual paychecks of zero dollars or manual paychecks with negative net pay amounts in self service. This check box is blank by default; you must select it if you want these checks displayed in self-service.

Paycheck Availability:
For each company and pay group combination, indicate the default timing of when paychecks should be available for viewing in the ePay self-service View Paycheck transaction. You can override this value when you run the check and advice print processes.

Days From Check Date

  • Enter 0 to make self-service paychecks available on the check date entered on the pay calendar for the pay run.
  • Enter a negative number to make self-service paychecks available the specified number of days before the check date entered on the pay calendar.
  • Enter a positive number to make self-service paychecks available the specified number of days after the check date entered on the pay calendar.
Note. If you have enabled viewing of historical paychecks, the paycheck data from the current pay run is visible in self service as soon as you run pay confirmation. Running the XML print process triggers the paycheck availability option for the PDF paycheck, after which the checks are not viewable until the availability date that you specify. For this reason, we recommend that you run the XML print process immediately after confirming the payroll.

4) Go to PeopleTools > Utilities > Administration > URLs

5) Enter PY_SSP_ATTACHMENT

6) The default location is table PS_PY_SSP_XML_DATA(url must be record://PS_PY_SSP_XML_DATA)

7) Assign the value "C:\TEMP" to “system-temp-dir" property in xdo.cfg file (path is ps_home\appserv)

8) Go to the navigation: Reporting Tools > XML Publisher > Report Definition > Bursting

9) Set the bursting field to “emp_id” for report name - PRTCNCHQ in the navigation This is not necessary if paychecks for all employees can be listed in one file. Selecting this option bursts paycheck file based every emplid and creates a unique file for every employee in the report manager.

Check Printing and YTD check data in prior Paychecks

This post answers the below two questions.

  1. What are the steps needed to print the paychecks as a PDF? 
  2. Why YTD data is not displayed in all pay checks?
Paychecks are displayed under the following navigation:
  1. Self Service > Payroll and compensation > View paycheck and
  2. Payroll for North America > Payroll Processing USA > Produce Payroll > Review Self Service Paycheck
It looks like in ePay module irrespective of the PeopleSoft HCM version, paychecks display YTD paycheck data on the current check only. The prior paychecks do not display the YTD information and this is how the delivered product works.

While Oracle has specified that this is not a delivered issue and is how the product actually works. However, customers might actually want the system to display YTD info on all paychecks irrespective of whether they are current or prior checks. What if customer wants to print PDF paychecks? 

HRMS release 8.9:
NA Payroll:
ePay PDF (XMLP) paycheck printing is not available for Payroll North America until release HCM 9.0. The only option for NA Payroll customers using HRMS 8.9 is to customize the application to print PDF paychecks. 
Global Payroll:
However this functionality - 'ePay PDF (XMLP) paycheck printing' is available on Global Payroll HCM 8.9 but not in North American Payroll. 

The XMLP feature is delivered in PeopleTools 8.48 and have to configure it.

HRMS release 9.0 and above:
NA Payroll & Global Payroll:
In release 9.0, a feature been introduced to generate paycheck in PDF format using XML Publisher. YTD amounts for earnings, taxes, deductions, as well as leave balances get displayed on all checks that are generated using this option. The required setup and other relevant details can be found in ePay PeopleBooks and North America PeopleBooks.

The XML data of the PDF checks and advices are stored in the database. As long as the XML data and the XMLP check/advice templates are in the database employee will be able to view his/her PDF checks or advices.

However Oracle does not provide a delivered strategy or process for archiving the historical XML data and its purely customer's responsibility. Click here to find out how to setup XMLP process for NA Payroll and run them.

Thursday, 3 January 2013

how to hide 10 level 0 fields at a time

  1. This task can be done by using group box
            record name: emp1(give u r own record name)
             fieldname: comm (u r own field)

     2    .in display tab display options check hide all fields when group box is hidden
     3    .write peoplecode in page active event

          emp1.comm.visible=false
           (recordname.fieldname.visible=false)

Processes getting Queued - - Why only one of either Application Engine or SQR or Crystal report programs only get queued in PeopleSoft Process Scheduler?

In PeopleSoft Process Scheduler, ever wondered why only a particular process type gets queued? SQRs only get queued when all other Process Types keep running in Process Scheduler. Or Application Engines (AE) only gets queued while SQRs, Crystal Reports, COBOL programs keep running. This is because there could be already few instances of Application Engine running in the Process Scheduler of the same process type and the count of AE processes equals the threshold limit set in the System Settings of the Process Scheduler.

In such cases check the process scheduler/master process scheduler logs. It could reflect that few processes are running by utilizing the maximum system resources and not giving way for other process of the same process type due to the settings in PeopleTools -> Process Scheduler -> System Settings page.

In such cases, manually stop/kill the processes which are no longer required. Alternatively you can think about increasing the maximum number of process instances allowed for a particular process type in Process Scheduler -> System Settings.

Wednesday, 2 January 2013

How to read long and short values (XLAT) values from a SQR?


Every PS resource knows that the translate values are stored in PSXLATITEM table. However to retrieve them in a SQR, PS provides a SQC which can be used to retrieve the XLAT(Translate) Values from PSXLATITEM table without adding a new procedure/SQL with the EFFDT and all the required conditions.

‘READXLAT.sqc’ is the SQC that can be used to read data from the PeopleSoft Translate Table(PSXLATITEM). How to access the values from this SQC?

  1. Include READXLAT.SQC in the SQR
  2. Populate $fieldname and $fieldvalue with the required fieldname and values for which Translate values are to be retrieved.
  3. Call the procedure Read-Translate-Table to retrieve the values from PSXLATITEM.
  4. Get either $XLATLongName or $XLATShortName to get Long or Short values respectively.

What are all the Various SQCs available ?

What are all the various SQCs available for use? Some of the times I end up writing my own procedures(absolute waste of time) due to lack of knowledge on various SQCs. Here is the list of some of the SQCs available. 
  1. Askftd.sqc - This asks from/thru date for reporting of heading
  2. Askaod.sqc - Procedure to call is Ask-As-of-Date
  3. CurDtTim.sqc - Gets the Current Date Time from System
  4. DateTime.sqc - Convert date from system format calling InitDate-Time procedure to set format.
  5. DateMath.sqc - Converts Native Date format to YYYY-MM-DD.
  6. Eoj.sqc - determines End of job for an SQR report.
  7. FSHdg01.sqc, FSHdg04.sqc - for Standard Headers for PS Financials.
  8. HRHdg01.sqc, HRHdg04.sqc - for Standard Headers for PS HCM.
  9. Number.sqc     - Provides Number related Functions
  10. Opsys.sqc - Operating system settings.
  11. PrcsApi.Sqc - Used in Process Scheduler SQR Programs, to get Run control parameters 
  12. RDBMS.sqc - Database Settings. These files uses #DEFINE command to set the variables.
  13. ReadXlat.sqc - Read the Translate Table for the desired values (Very Important)
  14. Reset.sqc - Used for Footing Section that prints ‘End-of-Report’.
  15. SetEnv.sqc - Sets Environment for Country, Printer-Paper, Language, Date,  Platform specific parameters, It also contains Opsys.sqc, RDBMS.sqc
  16. Setup01.sqc - This is generally called from Begin-Setup section for Portrait Size 
  17. Setup02.sqc - This is generally called from Begin-Setup section for Landscape Size
  18. STDHDGTR.sqc  - Performs Language Conversion
  19. STDHDG01.sqc - Provides Standard heading for language conversion
  20. StdApi.sqc - Gets Std API calls 
  21. Trancntrl.sqc - Purpose is to COMMIT, ROLLBACK etc. across DB platforms
  22. Convertcurrency.sqc - To convert currencies
  23. AllMaxes.max - It is used for dynamic memory allocations before the execution of SQR.