Saturday, April 28, 2012

Send Email with Color..

send emails with colours, tables and graphics, you have come to the right place. This post explains how to send html emails from peoplecode using the html option in sendmail. This can generate really good looking emails that stand out from the usual text only emails used for notifications. So here’s how we do it.
Local string &NL = "<br>"; /* The new line character in html */
/* Setting the parameters for sendmail */
&MAIL_FLAGS = 0;
&MAIL_TO = "email1@psoftsearch.com";
&MAIL_CC = "email2@psoftsearch.com";
&MAIL_BCC = "email3@psoftsearch.com";
&MAIL_SUBJECT = "Test Email";
&MAIL_FILES = "";
&MAIL_TITLES = "";

/* Making the email body */
&GREET = "<font face ="Arial">Dear " | &f_name | " " | &l_name | "," | &NL;
&MAIL_TEXT1 = "This is a test email that contains an HTML table." | &NL;
&MAIL_TEXT2 = "<table border='1'><tr bgcolor = '#AAAAAA' ><th>Name</th><th>State</th><th>Country</th></tr><tr><td>Rojer Alex</td><td>VA</td><td>USA</td></tr></table>" | &NL;
&TEXT1 = "Your footer line(s) goes here." | &NL | &NL;
&TEXT2 = "Regards," | &NL | "The PSoftSearch team";
&MAIL_FOOTER = &TEXT1 | &TEXT2 | "</font>";
&MAIL_TEXT_BODY = &MAIL_GREET | &MAIL_TEXT1 | &MAIL_TEXT2 | &MAIL_FOOTER;

/* Sending the email */
&RET_CODE = SendMail(&MAIL_FLAGS, &MAIL_TO, &MAIL_CC, &MAIL_BCC, &MAIL_SUBJECT, &MAIL_TEXT_BODY, &MAIL_FILES, &MAIL_TITLES, "", ";", "Content-type: text/html; charset=utf8");

/* Evaluating the return value of sendmail and showing the appropriate message */
If (&RET_CODE = 0) Then
MessageBox(0, "Alert", 0, 0, "Email has been sent.");
Else
MessageBox(0, "Alert", 0, 0, "Unable to send email.");
End-If;

Populating Data into Grid...

we would see how to populate a Grid dynamically using PeopleCode. Here we use a Dynamic View SGK_VCHR_DVW as the main record of the Grid.
The grid is placed on level 1 of a secondary page and is populated using Peoplecode written in the Activate event of the secondary page. We use the SQL object &VCHRS_GRD_SQL to fetch some Voucher IDs and Vendor IDs from the database and populate the grid with these values.
Local SQL &VCHRS_GRD_SQL;
/* SQL object for fetching the vouchers and vendors*/
Local Rowset &VCHRS_GRD_RS;
/*Rowset for accessing the Grid*/


&VCHRS_GRD_SQL = CreateSQL("SELECT V.VOUCHER_ID, V.VENDOR_ID FROM PS_VOUCHER V WHERE V.BUSINESS_UNIT =:1 AND V.ACCOUNTING_DT>:2", &SGK_BU, &SGK_ACCTG_DT);
/*creating the SQL statement*/


&VCHRS_GRD_RS = GetLevel0()(1).GetRowset(Scroll.SGK_VCHR_DVW);
/*creating a rowset corresponding to the grid */

While &VCHRS_GRD_SQL.Fetch(&GRD_VOUCHER_ID, &GRD_VENDOR_ID)
&VCHRS_GRD_RS(1).SGK_VCHR_DVW.VOUCHER_ID.Value = &GRD_VOUCHER_ID;
/*assigning the voucher ID to the filed in the grid */
&VCHRS_GRD_RS(1).SGK_VCHR_DVW.VENDOR_ID.Value = &GRD_VENDOR_ID;
assigning the Vendor ID to the filed in the grid
&VCHRS_GRD_RS.InsertRow(0);
/* inserting a new row at the beginning of the grid*/
End-While;

&VCHRS_GRD_RS.DeleteRow(1);
/* deleting the empty row left after all the insertions */
&VCHRS_GRD_SQL.Close();
/* closing the SQL object */
PeopleSoft Component Interface (CI) exposes a PeopleSoft Component for synchronous access to other applications written in PeopleCode, Java or C++. We can consider CI as the means by which PeopleSoft enforces encapsulation by limiting external access to just what is made available through the CI and nothing more.
A CI also executes the business logic included in the Component. As such, it provides a higher level of data validation to the data that is being loaded into the Component when compared to direct SQL inserts.
PeopleSoft also provides a Component Interface Tester to validate the CI and Excel To CI to manage loading data.
You can have as many CIs pointing to a Component as you want. But a Component Interface can point to only one Component.
Attributes of a Component Interface
A Component Interface has the following five attributes.
  • Name
  • Keys
  • Properties
  • Collections
  • Methods
Name
The Name of the Component Interface is the unique name by which we can identify the CI. Calling the CI is also done with the help of this name.
Keys
These are special properties that can retrieve the values from a CI. The three types of keys that a Component Interface has are the following:
Get Keys: These keys return one instance of the Component Interface. These keys are created based on the search record and map to the Search Keys in the search record.
Find Keys: These keys return a list of instances of the CI. These too are created based on the search record and map to the combination of Search Keys and Alternate Search Keys of the Search record.
Create Keys: Create keys are created only when the associated Component has the Add action enabled.
Properties
Properties of a CI provide access to the Component InterfaceĆ¢€™s settings and the data from the underlying Component. We can broadly classify properties into two:
Standard Properties: There are some properties that get assigned automatically when a CI gets created. These standard properties cannot be viewed through the Application Designer. Some examples for such properties are InteractiveMode, GetHistoryItems etc.
User Defined Properties: These properties map to the record fields on the Component. These are displayed in Application Designer and you can choose the properties that need to be included in the Component Interface.
Collections
This is a special property that corresponds to a scroll area. It can contain fields or subordinate scrolls, as is the case in the Component. The default name of a collection would be same as that of the primary record for the underlying scroll.
Methods
Methods are functions that perform a specific task on a CI at runtime. Runtime access to each method is governed by the security level that you have for the specific method. Like Properties, Methods too can be classified into two:
Standard Methods: These are the methods that are available for all CIs. Certain standard methods like Find, Get, Save and Cancel get created automatically when CI is created. The Create method is created only if the underlying Component has the Add action enabled.
User Defined Methods: In addition to the standard methods, we can create our own functions and expose them through the CI as methods for added functionality. Such methods are called user-defined methods. Each user defined method maps to a function. Such methods are highlighted in blue in the Component Interface Designer.

Thursday, June 9, 2011

PS Query Permissions/security

PS Query Permissions/Security in Peoplesoft


PS Query Permissions/Security

In Peoplesoft we cannot give access to any query directly like we provide it for components. user should have access to all the records in the query to access a particulary or use that record to create a query. Permission to the records needs to be provided first.

Private queries are visible to only those users who has created that query. query needs to be created as public for other users to access (given that they have access to all the records used in the query). security/permission to records are provide through query security tree and access groups.


In Query Tab of the Permission list set of query permission are present.

1) Access Group permission

2) Query Profile


Access group permission: This contains the list of the Access groups (nodes) in a particular query tree (it contain records that can be accessed) that a permission list has access.
Provide tree name and query access group here to get access to all records under query access group in this tree.

Tree Name and the Access group name needs to be entered.

Query Profile:
1)PeopleSoft Query
2)PeopleSoft Query Output
3) Advanced SQL Options

properties under each of these sections are set.
This defines what user can basically do with PS query.

PeopleTools > Security > Permission > Roles Permission Lists


Managing the query security tree

Query trees are accessible in Query Access group manager and not under the Tree manager.

PeopleTools > Security > Query Security > Query Access Group Manager.

Different trees for different category. Eg:- HR, BEFEFITS_ADMIN (contains BEFEFIT related records).


Each Leaf in the Tree corresponds to one record in this query tree.

Record is not Visible in PS Query ?

Add this record in the tree under the access group to which your primary permission list has access. (Query access group component)

OR

Add the access to your Tree and access group in which this record is present.

Type Ahead feature


Type Ahead feature in the Peoplesoft 9.1/Ptools 8.50

 
 
In PeopleSoft 9.1/ PeopleTools 8.50, they have introduced a new feature, as you type through a field it tries to provide possible values for the field.

Yes you can certainly disable the type ahead feature either globally (at User level) or at the Field level (all Users).

Globally.
My Personalization > Navigation Personalization > Type ahead = NO , default is YES

Field level:
To do it at a field level. It must fit the criteria. If you open up the field definition of the Record field Properties, the option lies there. But in order to use this feature , it will be turned on if the default page control is Edit Box or System Default. The Field has to be a search key or alternate search key and It must be either a Character, Number or Signal field.

Thursday, August 26, 2010

This is an attempt to list PeopleSoft meta-tables along with some kind of description for every table. The list will be broken into categories (pages, records, components, and so forth). Please feel free to add to or correct the list, this is a wiki page, so jump in!




PeopleSoft Projects

PSPROJECTDEFN table stores information about projects created in Application Designer.

Try it out:





SELECT * FROM PSPROJECTDEFN

WHERE PROJECTNAME = 'Your_Project_name';



PSPROJECTITEM table stores objects inserted into your Application Designer project.

Try it out:





SELECT * FROM PSPROJECTITEM

WHERE PROJECTNAME = 'Your_Project_name';



Portal Structure

PSPRSMDEFN is a Portal Structure Definition table. A good example is to use this table to find portal path for a specific component. Take a closer look on how this is done!.



PSPRSMPERM: Shows the permission lists that are assigned to a portal registry structure (content reference). The permission list name is under field PORTAL_PERMNAME.



XLAT Tables

XLATTABLE: Stores translate values (PeopleSoft version prior to 8.4).

PSXLATDEFN: Stores all fields that have Xlat values. This table does not store any Xlat values.

PSXLATITEM: Stores fields with their actual translate values (PeopleSoft version 8.4 and above).



Record & Field Tables

PSRECDEFN: Stores informations about tables. One row for each table. Field count and record type are two fields that are stored on this table.





CASE RECTYPE

WHEN 0 THEN 'Table'

WHEN 1 THEN 'View'

WHEN 2 THEN 'Derived'

WHEN 3 THEN 'Sub Record'

WHEN 5 THEN 'Dynamic View'

WHEN 6 THEN 'Query View'

WHEN 7 THEN 'Temporary Table'

ELSE TO_CHAR(RECTYPE)

END CASE



PSRECFIELD: Stores records with all their fields (sub-records are not expanded)



PSRECFIELDALL: Stores records with all their fields (sub-records are expanded)



PSINDEXDEFN: Contains 1 row per index defined for a table.



PSKEYDEFN: Containes 1 row per key field defined for an index.



PSDBFIELD: You got it, stores information about fields.





CASE FIELDTYPE

WHEN 0 THEN 'Character'

WHEN 1 THEN 'Long Character'

WHEN 2 THEN 'Number'

WHEN 3 THEN 'Signed Number'

WHEN 4 THEN 'Date'

WHEN 5 THEN 'Time'

WHEN 6 THEN 'DateTime'

WHEN 8 THEN 'Image'

WHEN 9 THEN 'Image Reference'

ELSE TO_CHAR(FIELDTYPE)

END CASE



PSDBFLDLABL: Stores field label information.



Process Definition Table(s)

PS_PRCSDEFNPNL: Stores the process definition name, process type(sqr report, application engine...), and the component name associated with the process definition.



PS_PRCSDEFN: Process definitions table. The record stores processes that can run within the Process Scheduler. Security information such as components and process groups are also stored on this table.



Message Catalog Tables

PSMSGCATDEFN: Stores information about PeopleSoft message catalogs such as message set number, message number and the actual message text.



PSMSGCATLANG: language table.





-- Example

SELECT * FROM PSMSGCATDEFN

WHERE LAST_UPDATE_DTTM > TO_DATE('03-DEC-07', 'DD-MON-YY')

AND LAST_UPDATE_DTTM < TO_DATE('05-DEC-07', 'DD-MON-YY')

ORDER BY MESSAGE_SET_NBR, MESSAGE_NBR;

-- This will return messages that has been last update/added between 2 specific dates.



Previous PeopleSoft message catalog tables:

PS_MESSAGE_CATALOG: Stores information about PeopleSoft message catalogs such as message set number, message number and the actual message text.

MESSAGE_SET_TBL: Message set description table.



-- Example

SELECT * FROM PS_MESSAGE_CATALOG

WHERE LAST_UPDATE_DTTM > TO_DATE('03-DEC-07', 'DD-MON-YY')

AND LAST_UPDATE_DTTM < TO_DATE('05-DEC-07', 'DD-MON-YY')

ORDER BY MESSAGE_SET_NBR, MESSAGE_NBR;

-- This will return messages that has been last update/added between 2 specific dates.



Menu Tables

PSMENUDEFN: Store Menu related information. No related component info on this table.



PSMENUITEM: List the menu with all components attached to it.



Component Tables

PSPNLGRPDEFN: Stores component related information only.



PSPNLGROUP: This table will give you information regarding a specific component along with the names of pages attached to it.



Pages

PSPNLDEFN: Stores pages definitions.





CASE PNLTYPE

WHEN 0 THEN 'Page'

WHEN 1 THEN 'Sub page'

WHEN 2 THEN 'Secondary page'

ELSE TO_CHAR(PNLTYPE)

END CASE



PSPNLFIELD: Stores all items used by each page definition.



CASE FIELDTYPE

WHEN 0 THEN 'Static Text'

WHEN 1 THEN 'Frame'

WHEN 2 THEN 'Group Box'

WHEN 3 THEN 'Statis Image'

WHEN 4 THEN 'Edit Box'

WHEN 5 THEN 'Dropdown List'

WHEN 6 THEN 'Long Edit Box'

WHEN 7 THEN 'Check Box'

WHEN 8 THEN 'Radio Button'

WHEN 9 THEN 'Image'

WHEN 10 THEN 'Scroll Bar'

WHEN 11 THEN 'Subpage'

WHEN 12 THEN 'Peoplecode Command - (Button/Hyperlink Destination)'

WHEN 13 THEN 'Scroll Action - (Button/Hyperlink Destination)'

WHEN 14 THEN 'Toolbar Action - (Button/Hyperlink Destination)'

WHEN 15 THEN 'External Link - (Button/Hyperlink Destination)'

WHEN 16 THEN 'Internal Link - (Button/Hyperlink Destination)'

WHEN 17 THEN 'Process - (Button/Hyperlink Destination)'

WHEN 18 THEN 'Secondary Page'

WHEN 19 THEN 'Grid'

WHEN 20 THEN 'Tree'

WHEN 21 THEN 'Secondary Page - (Button/Hyperlink Destination)'

WHEN 23 THEN 'Horizontal Rule'

WHEN 24 THEN 'Tab Separator'

WHEN 25 THEN 'Html Area'

WHEN 26 THEN 'Prompt Action - (Button/Hyperlink Destination)'

WHEN 27 THEN 'Scroll Area'

WHEN 29 THEN 'Page Anchor'

WHEN 30 THEN 'Chart'

WHEN 31 THEN 'Push Button/Link'

WHEN 32 THEN 'Analytic Grid'

ELSE TO_CHAR(FIELDTYPE)

END CASE



Security

PSPRSMPERM: Portal Structure Permissions.



PSAUTHITEM: Page Permissions. This table stores the information about the page level access for a permission list.



PSROLECLASS: Role Classes table. A many to many relationship table between Roles and Permission Lists.



PSROLEDEFN: This table stores information about Peoplesoft Role definitions. Users get permissions to PeopleSoft objects through Roles, which are assigned Permission Lists.



PSROLEUSER: This table stores information about the Users in Peoplesoft and the roles assigned to them.



PSCLASSDEFN: Permissions List definitions table. Permission list name can be found under Field Name CLASSID.



PSOPRDEFN: Users/Operator definition table. This table stores information about PeopleSoft users. This is the core table for User Profile Manager.



PSOPRCLS: Users/Operator and Perm list mapping Table. This table stores information about PeopleSoft users and the permission lists attached to those users.

A User gets these permission lists indirectly through the roles which are attached to the user



Here is an example query post that uses all of the above security tables!



URL Definitions

PSURLDEFN: Stores URL definitions. Here is the path to create URL definitions in PeopleSoft Root >> PeopleTools >> Utilities >> Administration >> URLs



Application Classes

PSAPPCLASSDEFN: Application Class Definitions table. You can use field PACKAGEROOT to search for a specific Application Package.



PeopleSoft Query Tables

PSQRYDEFN: Stores query related info.



PSQRYFIELD: Stores all fields used in a query (both the fields in the Select and Where clause).



PSQRYCRITERIA: Stores criteria query fields. You can get the name of the fields by joining the PSQRYFIELD table.



PSQRYEXPR: Stores query expressions.



PSQRYBIND: Stores query bind variables.



PSQRYRECORD: Stores all records used in all aspects of query creation



PSQRYSELECT: Stores all SELECT requirements by select type. Example would be sub select, join, ect.



PSQRYLINK: Stores the relationships to child queries.



PSQRYEXECLOG: Query run time log table that stores (only 8.4x and higher)



PSQRYSTATS: Query run time statistics table such as count of query execution, and date time of last execution (only in 8.4x and higher).



SQL Objects

PSSQLDEFN: Stores SQL object definitions.



PSSQLDESCR: Stores SQL objects descriptions, and description long.



PSSQLTEXTDEFN: Stores actual SQL text. You can filter by SQLTYPE field to get SQL objects of interest such as Views SQLs and Application Engine SQLs.





-- When SQL type is:

0 = Stand alone SQL objects

1 = Application engine SQL

2 = Views SQLs



Application Engines

PSAEAPPLDEFN: Table that stores Application Engine program definitions.



PSAEAPPLSTATE: Stores application engine STATE records and a flag to indicate if the record is the default STATE record.



PSAESECTDEFN: Application engine section information and also stores last user id to update a specific section.



PSAESECTDTLDEFN: AE section along with descriptions and wither the section is active or not.



PSAEAPPLTEMPTBL: If your application engine uses Temp tables it will show on this record.



PSAESTEPDEFN: Steps in application engines are stored in this table.



PSAESTMTDEFN: Stores your application engine actions and along with their types, such as "Do Select" and so on.



PSAESTEPMSGDEFN: Application engine message action definition table.



AEREQUESTTBL: Application Engine request table behind the AE run control page.



AEREQUESTPARM: Application Engine request parameters table behind the AE run control page.



PeopleCode Tables

PSPCMNAME: PeopleCode Reference table.



PSPCMPROG: Store actual PeopleCode programs (actual code behind PeopleCode events).



Process Request Tables

PSPRCSQUE: This record contains the process request information to run a process request.



PSPRCSRQST: This record contains the process request information to run a process request.



PS_PMN_PRCSLIST: A view to list all process requests in the Process Monitor except for "Delete" (runstatus = 2) process requests.



Other Useful Tables

PSSTATUS: Stores PeopleSoft information such as PS Tools release version and the UNICODE_ENABLED boolean flag where a value of 1 indicates the DB is to be treated by Tools as a UNICODE DB.



PSCHGCTLLOCK: Description as explained by PeopleSoft "This table contains a a row for every object that is currently locked by any user. When the user requests to lock an object in the Application Designer, first this table is searched to see if the object is locked by another user. If it is not found, a row is inserted into the table. When the user requests to unlock an object, the row in this table is deleted."

Visit this post to see how could you make use of this table.



PSMAPFIELD: Stores Field mapping of Activity

PS_PRCSRUNCNTL: Run Control record stores Run Control IDs created online.

Tuesday, August 10, 2010

PUB/SUB services Bounce

Servername:/apps> cd hrprd


Servername:/apps/hrprd> . ./psconfig.sh

Servername:/apps/hrprd> cd appserv

Servername:/apps/hrprd/appserv> psadmin



PSADMIN -- Tools Release: 8.49.25

Copyright (c) 1988, 2003, Oracle. All rights reserved.



--------------------------------

PeopleSoft Server Administration

--------------------------------





1) Application Server

2) Process Scheduler

3) Search Server

q) Quit





Command to execute (1-3, q): 1





--------------------------------------------

PeopleSoft Application Server Administration

--------------------------------------------



1) Administer a domain

2) Create a domain

3) Delete a domain

4) Import domain configuration

q) Quit



Command to execute (1-4, q) : 1





Tuxedo domain list:



1) HRPRD



Select domain number to administer: 1







--------------------------------

PeopleSoft Domain Administration

--------------------------------

Domain Name: HRPRD



1) Boot this domain

2) Domain shutdown menu

3) Domain status menu

4) Configure this domain

5) TUXEDO command line (tmadmin)

6) Edit configuration/log files menu

7) Messaging Server Administration menu

8) Purge Cache

9) Preload File Cache

10) Clean IPC resources of this domain

q) Quit



Command to execute (1-10, q) : 5

Loading command line administration utility ...

tmadmin - Copyright (c) 1996-1999 BEA Systems, Inc.

Portions * Copyright 1986-1997 RSA Data Security, Inc.

All Rights Reserved.

Distributed under license by BEA Systems, Inc.

Tuxedo is a registered trademark.



> shutdown -g PUBSUB



Shutting down server processes ...



Server Id = 300 Group Id = PUBSUB Machine = Servername: shutdown succeed

ed

Server Id = 302 Group Id = PUBSUB Machine = Servername: shutdown succeed

ed

Server Id = 301 Group Id = PUBSUB Machine = Servername: shutdown succeed

ed

Server Id = 200 Group Id = PUBSUB Machine = Servername: shutdown succeed

ed

Server Id = 202 Group Id = PUBSUB Machine = Servername: shutdown succeed

ed

Server Id = 201 Group Id = PUBSUB Machine = Servername: shutdown succeed

ed

Server Id = 100 Group Id = PUBSUB Machine = Servername: shutdown succeed

ed

Server Id = 102 Group Id = PUBSUB Machine = Servername: shutdown succeed

ed

Server Id = 101 Group Id = PUBSUB Machine = Servername: shutdown succeed

ed

9 processes stopped.



> boot -g PUBSUB

INFO: BEA Tuxedo, Version 9.1, 64-bit, Patch Level 036

INFO: Serial #: 650522264137-2065448083901, Expiration NONE, Maxusers 1000000

INFO: Licensed to: Oracle-Peoplesoft-ISV



Booting server processes ...



exec PSBRKHND -p 1,600:1,1 -s PSBRKHND_dflt:BrkProcess -- -C psappsrv.cfg -D HRP

RD -S PSBRKHND_dflt :

process id=22564 ... Started.

exec PSBRKHND -p 1,600:1,1 -s PSBRKHND_dflt:BrkProcess -- -C psappsrv.cfg -D HRP

RD -S PSBRKHND_dflt :

process id=22569 ... Started.

exec PSBRKDSP -s PSBRKDSP_dflt:Dispatch -- -C psappsrv.cfg -D HRPRD -S PSBRKDSP_

dflt :

process id=22572 ... Started.

exec PSPUBHND -p 1,600:1,1 -s PSPUBHND_dflt:PubConProcess -- -C psappsrv.cfg -D

HRPRD -S PSPUBHND_dflt :

process id=22577 ... Started.

exec PSPUBHND -p 1,600:1,1 -s PSPUBHND_dflt:PubConProcess -- -C psappsrv.cfg -D

HRPRD -S PSPUBHND_dflt :

process id=22580 ... Started.

exec PSPUBDSP -s PSPUBDSP_dflt:Dispatch -- -C psappsrv.cfg -D HRPRD -S PSPUBDSP_

dflt :

process id=22583 ... Started.

exec PSSUBHND -p 1,600:1,1 -s PSSUBHND_dflt:SubConProcess -- -C psappsrv.cfg -D

HRPRD -S PSSUBHND_dflt :

process id=22590 ... Started.

exec PSSUBHND -p 1,600:1,1 -s PSSUBHND_dflt:SubConProcess -- -C psappsrv.cfg -D

HRPRD -S PSSUBHND_dflt :

process id=22593 ... Started.

exec PSSUBDSP -s PSSUBDSP_dflt:Dispatch -- -C psappsrv.cfg -D HRPRD -S PSSUBDSP_

dflt :

process id=22596 ... Started.

9 processes started.