PeopleTools Tables

March 20, 2018 | Author: chakrips | Category: Web Service, Soap, Xml, Xml Schema, World Wide Web


Comments



Description

PeopleSoft PeopleTools Meta-TablesPeopleSoft 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!. Query for Component Path within PeopleSoft Portal 1) Run the below SQL to get the content reference name for your component SELECT PORTAL_NAME, PORTAL_OBJNAME AS CONTENT_REFERENCE, PORTAL_LABEL, PORTAL_URI_SEG1 AS MENU, PORTAL_URI_SEG2 AS COMPONENT, PORTAL_URI_SEG3 AS MARKET FROM psprsmdefn WHERE PORTAL_NAME = 'EMPLOYEE' AND PORTAL_URI_SEG2 = :1; -- Replace :1 with the component name you are looking for. 2) From the query above - copy the value in the CONTENT_REFERENCE field and replace the ":1" variable and you will have the path to your component. WITH portal_registry AS (SELECT RTRIM(REVERSE(sys_connect_by_path(REVERSE(portal_label), ' >> ') path, LEVEL lvl FROM psprsmdefn WHERE portal_name = 'EMPLOYEE' START WITH PORTAL_OBJNAME = :1 CONNECT BY PRIOR portal_prntobjname = portal_objname) SELECT path FROM portal_registry WHERE lvl = (SELECT MAX(lvl) FROM portal_registry); ' >> ')), So, the 1st query is to get the content reference for a component name that you know and then using Jim's query to find the path! 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. PSPNLFIELD: Stores all items used by each page definition. 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. portal_objname = :2).PSOPRCLS: Users/Operator and Perm list mapping Table. and Users Assigned to Portal Content Reference or Component Roles attached to a component (portal_uri_seg2) or content reference (portal_objname) SELECT DISTINCT c.rolename = e.portal_name.classdefndesc FROM psprsmperm c. c.portal_objname AND b. Users that can access a component (portal_uri_seg2) or content reference (portal_objname) SELECT DISTINCT c.rolename AND (d. psprsmdefn d. b. 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! Roles. This table stores information about PeopleSoft users and the permission lists attached to those users.roleuser. Permissions.portal_objname.portal_permname = e.portal_uri_seg2 = :1 OR d.portal_name = c.descr FROM psroleclass b. d. c.portal_permname. psprsmdefn d. psclassdefn e WHERE d.classid AND (d. psroledefn e WHERE c.portal_uri_seg2 = :1 OR d.rolename.oprdefndesc .portal_objname = d.portal_permname AND b. e.portal_objname.portal_objname = c. Permissions attached to a component (portal_uri_seg2) or content reference (portal_objname) SELECT DISTINCT d. psprsmperm c. a.portal_name.portal_objname AND d. c.portal_objname = :2).classid = c.portal_name.portal_objname. e. e.portal_name AND c. . psoprdefn e WHERE c. join. psprsmdefn d.portal_uri_seg2 = :1 OR d.rolename AND b. You can get the name of the fields by joining the PSQRYFIELD table. PSQRYBIND: Stores query bind variables. URL Definitions PSURLDEFN: Stores URL definitions.roleuser = e. PSQRYCRITERIA: Stores criteria query fields.portal_permname AND a.classid = c.rolename = b. Example would be sub select. 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. ect. psroleclass b. PSQRYEXPR: Stores query expressions. PSQRYFIELD: Stores all fields used in a query (both the fields in the Select and Where clause).FROM psroleuser a. psprsmperm c. PSQRYRECORD: Stores all records used in all aspects of query creation PSQRYSELECT: Stores all SELECT requirements by select type.portal_objname = d. PSQRYLINK: Stores the relationships to child queries.portal_objname AND a.oprid AND (d. PeopleSoft Query Tables PSQRYDEFN: Stores query related info.portal_objname = :2). PSAESTEPDEFN: Steps in application engines are stored in this table.4x and higher) PSQRYSTATS: Query run time statistics table such as count of query execution. PSSQLDESCR: Stores SQL objects descriptions. PSSQLTEXTDEFN: Stores actual SQL text.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. AEREQUESTPARM: Application Engine request parameters table behind the AE run control page.4x and higher). AEREQUESTTBL: Application Engine request table behind the AE run control page. PSAESTMTDEFN: Stores your application engine actions and along with their types. PSAEAPPLTEMPTBL: If your application engine uses Temp tables it will show on this record. You can filter by SQLTYPE field to get SQL objects of interest such as Views SQLs and Application Engine SQLs.PSQRYEXECLOG: Query run time log table that stores (only 8. and date time of last execution (only in 8. PSAESTEPMSGDEFN: Application engine message action definition table. PSAESECTDEFN: Application engine section information and also stores last user id to update a specific section. and description long. PSAESECTDTLDEFN: AE section along with descriptions and wither the section is active or not. such as "Do Select" and so on. . -. SQL Objects PSSQLDEFN: Stores SQL object definitions. When the user requests to lock an object in the Application Designer. so here is a way to speed up the process." Visit this post to see how could you make use of this table. 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. After few good size projects. If it is not found.PeopleCode Tables PSPCMNAME: PeopleCode Reference table. PS_PMN_PRCSLIST: A view to list all process requests in the Process Monitor except for "Delete" (runstatus = 2) process requests. Locked objects are stored on PSCHGCTLLOCK table. When the user requests to lock an object in the Application Designer. Here is how PeopleSoft describes the table: This table contains a a row for every object that is currently locked by any user. Process Request Tables PSPRCSQUE: This record contains the process request information to run a process request. Unlock PeopleSoft Objects All at Once (Change Control Locking): Change control is used in Application Designer to lock definitions and track history changes for each object. a row is . PSCHGCTLLOCK: Description as explained by PeopleSoft "This table contains a a row for every object that is currently locked by any user. Attempting to unlock the objects one by one is very time consuming. If it is not found. you can easily have hundreds if not thousands of locked objects. first this table is searched to see if the object is locked by another user. PSPRCSRQST: This record contains the process request information to run a process request. the row in this table is deleted. Change control can be activated through Application Designer using Tools > Change Control > Administrator. first this table is searched to see if the object is locked by another user. PSPCMPROG: Store actual PeopleCode programs (actual code behind PeopleCode events). When the user requests to unlock an object. a row is inserted into the table. pspnlfield b WHERE (a. DELETE FROM pschgctllock WHERE oprid = :userid. SELECT recname FROM pspnlgroup a. I would feel safe enough to assume that if you want to unlock objects. you can also delete by object name or object type.inserted into the table. the row in this table is deleted.subpnlname) AND a. From the description above. Select an object to unlock it (Ctrl+click) to select more than one. Right click and chose unlock object. just delete them from this table! Here is an example to delete by operator ID. .deletes locked objects by user id.pnlgrpname = :component_name GROUP BY recname Get all Components Under a Certain Portal Folder Use this SQL snippet to return all components plus sub-folders (if any) under a specific portal folder.pnlname = b. Get Records on a Component An SQL that goes against a specific component and bring back ALL related records. When the user requests to unlock an object. PSMAPFIELD: Stores Field mapping of Activity PS_PRCSRUNCNTL: Run Control record stores Run Control IDs created online. -.pnlname OR a. it was brought to my attention by a college of mine that Application Designer has a feature to accomplish the same result as deleting from pschgctllock table.pnlname = b. Is this the only way we can "batch" unlock objects? No. PORTAL_URI_SEG3 AS MARKET. PORTAL_PRNTOBJNAME. Run the SQL against the Workforce Admin folder and you should get a row for the sub-folder. PORTAL_URI_SEG1.Get all sub-folders and components under a certain folder name -SELECT PORTAL_NAME. PORTAL_OBJNAME. -. . PORTAL_LABEL. PORTAL_URI_SEG2 AS COMPONENT. Under Job Information. lets say you have a folder called "Workforce Admin". portal_reftype. PORTAL_LABEL. PORTAL_OBJNAME AS CONTENT_REFRENCE. PORTAL_URI_SEG1 AS MENU. you have a sub-folder called "Job Information" and few components. portal_reftype FROM psprsmdefn WHERE portal_name = 'EMPLOYEE' START WITH PORTAL_LABEL = ':1' CONNECT BY PRIOR portal_objname = portal_prntobjname GROUP BY PORTAL_NAME. PORTAL_PRNTOBJNAME AS FOLDER.For example. and a row for each of the components. PORTAL_URI_SEG2. PORTAL_URI_SEG3 ORDER BY portal_reftype DESC. my_data WHERE pnlname = :1 OR pnlname = my_data. Same query as above but written differently (suggested by a colleague of mine): SELECT recname FROM pspnlfield a WHERE pnlname = :1 OR EXISTS ( SELECT 'x' FROM pspnlfield b WHERE pnlname = :1 .PORTAL_NAME is your folder name -. -. WITH my_data AS (SELECT subpnlname FROM pspnlfield WHERE pnlname = :1 AND subpnlname <> ' ' GROUP BY subpnlname) SELECT recname FROM pspnlfield.subpnlname GROUP BY recname. Replace "START WITH PORTAL_LABEL = ':1'" with "START WITH PORTAL_OBJNAME = ':1'" Identify Records Behind a Page and Subpage Use the following query to get records behind not only the page but sub-pages on a page.You might get better results if you know the portal object name. Is component attached to a menu? -. 1. Here is a query you can use to identify records that have a specific subrecord. views and temp tables.objectownerid FROM psrecfield a. 7 temp table AND b.fieldname.recname. Make sure you modify (re-build.AND subpnlname <> ' ' AND a. view. a. psrecdefn b WHERE a. b.objectownerid FROM psrecfield a.rectype IN (0. 1 view. b. 7) ORDER BY a.pnlname = b. SELECT a.recname. b.subpnlname) GROUP BY recname. psrecdefn b WHERE a.List all the Menus that have a specific component . a. Is Component Attached to a Menu? This SQL will help you find the menus a specific component is attached to.rectype. You can use the SQL above to track down all the affected record but you really only want actual physical tables. or a temp table.fieldname.recname.recname = b.0 table.recname = b. b.recname AND a. Identify Records with a Specific Subrecord A subrecord in PeopleSoft is a way to group fields together and place them on a record. we will add rectype criteria to filter our results. or alter) all the tables that the subrecord touches.fieldname = 'SUB-RECORD-NAME'. So.rectype.recname AND a. -.fieldname = 'SUB-RECORD-NAME' -. SELECT a. When you modify a subrecord in Peopltools as for example adding a field to it. This is needed as accounts that had activities in 2007. a.descr.ACCOUNT = b. Is there a sql that can be run to identify such pages ? Here is how you accomplish the above: . if I am looking for emplid field and determine that the emplid field is used on say 5 secondary pages. SELECT a.g. The question was: Is there a way to determine all the pages with a secondary page with a specific field ? For e.ACCOUNT. for example.ACCOUNT.fiscal_year = :year AND accounting_period <> 0) GROUP BY a.SELECT * FROM PSMENUITEM menu WHERE pnlgrpname = :component_name AND ITEMTYPE <> 8. Pages with Secondary Pages That Use a Field Here is a question that was asked on the forum and thought it will be of a value to add it to the PeopleSoft handbook to keep for future references.ACCOUNT AND b. I now need to tie those secondary pages to the pages . a. List of Active Accounts with no activity for a Fiscal Year SQL to find active accounts that have no activity in a specific fiscal year. will have a row on the ledger table under year 2008 and accounting period of 0.eff_status = 'A' AND NOT EXISTS (SELECT 'x' FROM ps_ledger b WHERE a. Notice the accounting_period <> 0 in the where clause.descr FROM ps_gl_account_tbl a WHERE a. my_data. subpnlname FROM pspnlfield WHERE (subpnlname <> '' OR subpnlname <> ' ') AND fieldtype <> '11' GROUP BY pnlname. pspnlfield FIELD WHERE my_data. my_data.fieldtyp 11 means it is a subpage and you want secondary pages) and the 2nd select will look for a specific field on secondary pages found. .pnlname AND FIELD.pnlname.fieldname = 'Yourfield' GROUP BY my_data.The 1st select will get all pages that have secondary pages on them (thus the fieldtype <> '11' .subpnlname.subpnlname FROM my_data. subpnlname) SELECT my_data. my_data. Please test it and let us know if it works! WITH my_data AS (SELECT pnlname. fieldtype.subpnlname ORDER BY my_data.subpnlname = FIELD.pnlname. fieldtype.pnlname. compdfn.classdefndesc permission_desc FROM psauthitem auth.classid permission_list. pspnlgroup comp. psclassdefn CLASS WHERE menu. psmenuitem menuitm.pnlgrpname LIKE UPPER (:component_name) .pnlgrpname AND compdfn.menuname = menuitm.menuname AND menuitm. psmenudefn menu. pspnlgrpdefn compdfn.pnlgrpname = comp. CLASS.pnlgrpname AND compdfn. auth.menuname.pnlgrpname.Peoplesoft Security Component Permission List Query An SQL that will identify permission lists along with permission lists description assigned to a specific component. SELECT menu.pnlgrpname = comp. portal_label AS PORTAL_LINK_NAME. compdfn.menuname.portal_objname. CLASS. SELECT a.classid = b.baritemname = menuitm.pnlitemname = comp. permission_list.barname AND auth.portal_reftype FROM psprsmdefn a.pnlgrpname.classid = :permissionlist AND a.classid. .classdefndesc ORDER BY menu.menuname.portal_uri_seg3 <> ' ' AND c.menuname = menu.portal_name = b.portal_objname = b. a.menuname AND auth.portal_uri_seg1 <> ' ' AND a. psclassdefn c WHERE a. compdfn.portal_uri_seg2 <> ' ' AND a.portal_cref_usgt = 'TARG' AND a.barname = menuitm.classid = CLASS.pnlgrpname. auth.portal_objname AND c.AND auth.portal_name = :portalname ORDER BY portal_label.portal_name.portal_reftype = b. a. a.itemname AND auth.portal_name AND a.itemname AND auth. psprsmperm b.classid GROUP BY menu.portal_reftype = 'C' AND a.portal_reftype AND a.portal_permname AND a. Content References Accessed by a Permission List Another permission list query to list Content References accessed by a specific Permission List. 'No'.classid AND ( b. b. SELECT DISTINCT b.authorizedactions = c.pageaccessdescr. PeopleTools Objects Accessed by a Permission List A query that will list all peopletools objects (Query. Other available translates on that field are: FRMT = Frame template HPGC = Pagelet HPGT = Homepage tab HTMT = HTML template LINK = Content Reference Link It is important to note that knowing the content reference will make it easy to find the path (PIA navigation) for that content ref. b. SELECT b.menuname. Data Mover) that a specific permission list could access.menuname FROM psclassdefn a.baritemname > ' ' AND b.classid = b. Here is a post to help you with that. pspgeaccessdesc c WHERE a. Application Designer.classid AND a.baritemname. 'Yes') AS displayonly FROM psclassdefn a. Pages Accessed by a Permission List A query to identify pages that could be accessed by a specific permission list.classid = :1 AND b.We are only interested in translate value of 'TARG' (target) from field portal_cref_usgt on table psprsmdefn. b. 1.pnlitemname AS pagename. c.authorizedactions. psauthitem b. 0. psauthitem b WHERE a.displayonly.menuname = 'DATA_MOVER' .menuname = 'CLIENTPROCESS' OR b. DECODE (b.barname.classid = b. classid = b. Example.OR b. SELECT b. SELECT c. b. c.roleuser.baritemname. d.rolename AND a.menuname.rolename.roleuser AS USER_IDs FROM psclassdefn a. pspgeaccessdesc c.classid AND b. User IDs assigned to a Permission List A query to list all user IDs that are assigned to a specific permission list.rolename = c.pageaccessdescr FROM psroleclass a.menuname = 'IMPORT_MANAGER' OR b. SELECT b. Roles Assigned to a Permission List A query to help you identify Roles that are assigned to a specific permission list.classid = :PermissionList.classid AND a. psroleuser c WHERE a. psauthitem b.menuname = 'OBJECT_SECURITY' OR b. psroleclass b. b. The query will also indicate what kind of operations a user can perform on that page.menuname = 'QUERY' ) AND a. Add Update/Display and so forth.pnlname.classid = b. psroleclass b WHERE a.classid = :permissionlist.barname. .menuname = 'APPLICATION_DESIGNER' OR b.classid AS permission_list FROM psclassdefn a. A List of Pages a Peoplesoft Role Name can Access A query that will take a PeopleSoft role name as an input and returns all pages that could be access by that role.classid = :permissionlist GROUP BY c. b. DESCR FROM PSROLEDEFN A. C.pnlname.barname AND b.menuname = e. b.ROLEUSER .menuname AND b. SELECT C.pnlgrpname = e.barname = e.baritemname.ROLENAME = A. d.pageaccessdescr ORDER BY d.OPRDEFNDESC .menuname. A.ROLENAME AND C.pnlgrpname AND b.rolename = :rolename AND b. PSROLEUSER B PSOPRDEFN C WHERE B.authorizedactions = c. Show Users Assigned to a Specific Role here is how you find out what Users are assigned to a specific Role.ROLENAME A. .OPRID = B.pspnlgroup d. A. C. psmenuitem e WHERE a.baritemname = e.classid = b.classid AND d.OPRDEFNDESC . .OPRID.itemname AND a.barname.pnlname. b. AND B. c.OPRID .ROLENAME .authorizedactions GROUP BY b.ROLENAME LIKE UPPER(:1) GROUP BY C. OPRID.Make sure when passing the :2 value to pass % with it for the 'Like' search to work. At run time.OPRDEFNDESC LIKE upper(:2)) GROUP BY C. OR C. A.ROLENAME A.DESCR FROM PSROLEDEFN A.OPRID.OPRDEFNDESC . Show Roles Assigned to a Specific User Here is a query that I often use to lookup Roles assigned to a specific PeopleSoft user.ROLENAME AND C. . SELECT a. -.ROLENAME = A. C. C.ROLENAME A. a.rolename. . example :2 = %John% What Permission Lists does this Role Have? A query that takes a PeopleSoft role name as a value and returns Permission List(s) associated to that role.DESCR.OPRID = B.classid AS permission_list .DESCR ORDER BY C.ROLEUSER =:1 .OPRID AND (C. .A. replace :1 with OPRID your are looking for OR user name (partial search also works).OPRDEFNDESC A. PSROLEUSER B PSOPRDEFN C WHERE B. SELECT C.OPRID. oprid. A. a.classid AND c.BARITEMNAME .rolename = :rolename. a.rolename AND d. a. d.CLASSID . Permission Lists Assigned to a User SQL that I find useful in many occasions. -.rolename = a.roleuser AND d.oprid = :userid GROUP BY d. b.rolename.classid = b.at run time.rolename.ROLENAME FROM PSROLECLASS A . Roles Assigned to a Component The SQL will pull Roles assigned to a specific component.classid.oprid.oprdefndesc.oprid = c. psclassdefn b. psoprdefn d WHERE a.FROM psroleclass a WHERE a. B. b. PSAUTHITEM B WHERE A. c.CLASSID = B. a. psroleuser c. c.classid. d.oprdefndesc.roleuser. SELECT d.classdefndesc. SELECT B.MENUNAME. substitute :userid with the user id you want the SQL to run against.roleuser.classdefndesc FROM psroleclass a. It will return a list of permissions that are assigned to a specific user. MESSAGE_SET_NBR . you could run the query to get email addresses for users who have a role name of "Developer".AND B. BUSINESS_UNIT . PeopleSoft Account Payables PeopleSoft Validate AP Business Unit The select statement below is preformed by AP Voucher Build (AP_VCHRBLD) Application Engine to validate an AP Business Unit: INSERT INTO %TABLE(VCHR_HDR_QV_ER) (PROCESS_INSTANCE .BARITEMNAME = :1 -. A. Users and Emails Under a Certain Role The query will help you find users with their email addresses for a certain Role Name.MENUNAME. psrolemember WHERE rolename = :role_name AND oprid = roleuser AND emailid <> ' ' For example. VOUCHER_ID . SELECT emailid .COMPONENT NAME GROUP BY B.MENUNAME. B.ROLENAME.BARITEMNAME A. .oprid FROM psoprdefn .ROLENAME ORDER BY B. '' .BUSINESS_UNIT . BUSINESS_UNIT .BUSINESS_UNIT .'' FROM %TABLE(VCHR_HDR_TMP) HDR WHERE PROCESS_INSTANCE = %Bind(PROCESS_INSTANCE) AND BUSINESS_UNIT NOT IN ( SELECT BUSINESS_UNIT FROM %TABLE(BUS_UNIT_TBL_AP) BUS WHERE HDR. HDR. 7220 . MESSAGE_PARM2 .. 'BUSINESS_UNIT' . HDR. HDR. VOUCHER_ID . MESSAGE_PARM1 . FIELDNAME . MESSAGE_NBR . MESSAGE_SET_NBR .1 .BUSINESS_UNIT) PeopleSoft Validate Vendor ID The select statement below is performed by AP Voucher Build (AP_VCHRBLD) Application Engine to validate a Vendor ID: INSERT INTO %TABLE(VCHR_HDR_QV_ER) (PROCESS_INSTANCE .VOUCHER_ID .BUSINESS_UNIT = BUS. MESSAGE_PARM3) SELECT %Bind(PROCESS_INSTANCE) . VENDOR_SETID . MESSAGE_PARM1 . 'VENDOR_ID' .VENDOR_ID .prcsname. HDR. b. HDR.rundttm. a.VENDOR_SETID = VND. .VENDOR_ID = VND. MESSAGE_PARM2 . MESSAGE_PARM3) SELECT %Bind(PROCESS_INSTANCE) .oprid.PROCESS_INSTANCE = %Bind(PROCESS_INSTANCE) AND VENDOR_ID NOT IN ( SELECT VENDOR_ID FROM %TABLE(VENDOR) VND WHERE HDR.2 .BUSINESS_UNIT . MESSAGE_NBR . HDR. a.xlatlongname AS STATUS..VENDOR_ID AND HDR. 7220 .SETID AND VND.VOUCHER_ID . FIELDNAME . HDR. a.servernamerun. SELECT a.VENDOR_STATUS = 'A' ) SQL to Check PeopleSoft Process Name Status Run this SQL on a particulare process name to get it's process status form PeopleSoft process request.'' FROM %TABLE(VCHR_HDR_TMP) HDR WHERE HDR. rundttm) * 24 * 60.prcsinstance = c. c. PSXLATITEM b.xlatlongname AS STATUS.enddttm .prcsinstance AND a. You would need to change table xlattable to PSXLATITEM for the SQL to work.enddttm .TRUNC (MOD ((a. a.outputdir FROM psprcsrqst a.prcsinstance. 60)) sec.prcsname.prcsinstance.enddttm . ps_cdm_list c WHERE b. 24)) "Hr".prcsname = 'your_process_name' . TRUNC (MOD ((a.rundttm) * 24 * 60.enddttm .a.rundttm) * 24.prcsinstance = c.runstatus AND a. TRUNC (MOD ((a.outputdir FROM psprcsrqst a. 60)) sec.oprid.a.a.49 due to table name change. 24)) "Hr".prcsinstance AND a.fieldvalue = a. c.enddttm .servernamerun. a.a.a. a.rundttm. Here is an update version: SELECT a.fieldvalue = a.runstatus AND a.rundttm) * 24 * 60 * 60. b. TRUNC (MOD ((a. ps_cdm_list c WHERE b.rundttm) * 24.prcsname = 'YourProcessName' ORDER BY 5 DESC Update: 01/10/08 I noticed the above SQL doesn't work in PT 8. 60)) mi.a.fieldname = 'RUNSTATUS' AND b. 60)) mi. TRUNC (MOD ((a. a.fieldname = 'RUNSTATUS' AND b. xlattable b. a. TRUNC (MOD ((a.rundttm) * 24 * 60 * 60.enddttm . e. Suppose an Organization has 7 levels in Dept tree i.TREE_LEVEL_NUM FROM PSTREENODE TR WHERE TR.TREE_NAME AND TR_ED.TREE_NODE = TR. Traversing the Dept Security tree We can use the connect by prior function provided by Oracle to traverse the Dept security Tree . I have written the following SQL to help me identify the last person to modify a Record Field PeopleCode Event.SETID = 'DEPT_SECURITY' = $SETID AND TR.SETID = TR_ED.PARENT_NODE_NAME START WITH TR.EFFDT <= TO_DATE (SYSDATE. BUT it is not that easy when it comes to PeopleCode.TREE_NAME AND TR. We can use the following SQL to traverse the whole tree (3-6) starting from 'LVL3DPT'.3 + 1) CONNECT BY PRIOR TR. The starting deptid has to be used with "START WITH " clause.EFFDT = (SELECT MAX(TR_ED. Also we know the deptid at the level 3 say 'LVL3-DPT' . We want to traverse the dept tree from level 3 to level 6. It is easy to figure out who was the last person to touch a record by clicking on the Record Properties button in application designer. Only child of 'LVL3-DPT' will be seen in sql output.TREE_NAME = TR_ED. .TREE_NODE = 'LVL3-DPT' Who Modified this PeopleCode? Nothing frustrates me more than developers modifying delivered PeopleSoft code without adding comments.EFFDT) FROM PSTREENODE TR_ED WHERE TR.ORDER BY 5 DESC. SELECT TR.TREE_NODE .SETID AND TR. TR. 1 to 7 . 'DD/MM/YY')) AND LEVEL <= (6 . objectvalue2 field_name.Report Development PeopleSoft XML Publisher This article explains how to create XML Publisher also called BI Publisher reports in PeopleSoft. I would like to give a brief overview. Rowset 3. XML Publisher is the only Reporting platform in the Fusion Application. XML File 4. XMLDoc Object . objectvalue3 peoplecode_event. page. lastupddttm. The SQL could be easily modified to work on any PeopleCode event level (component. PeopleSoft XML Publisher . Before we talk about how to create an XML Publisher report in PeopleSoft.SELECT objectvalue1 record_name. Overview: XML Publisher consists of the following components: • Data Source • Template • XML Publisher Engine • Report Data source can be defined using in the following forms: 1. PS Query 2. lastupdoprid FROM pspcmprog WHERE objectvalue1 = :record_name AND objectvalue2 = :field_name AND UPPER (objectvalue3) = UPPER (:peoplecode_event). or Record level). My need was to write it against Record Field PeopleCode. Security – Specify the Role or User who should have access to the report. 3. Open MS Word after you have installed the plug-in. Go to Reporting Tools  XML Publisher  Setup  Report Definition and add a value. 1. Select either PS Query or Rowset. Specify the report name. Output – Specify the output report format and set a default format. . Bursting – Specify the criteria if you need to burst the report. Click on the first button i. data source type and data source name. Template – Upload the template file created in Step 2. If you wish to use Rowset then write an Application Engine program that writes Rowset in the form of XML data and XSD schema. Leave it blank if bursting is not needed. Steps to create XML Publisher Report: Step 1 – Data Source: Go to Reporting Tools  XML Publisher  Setup  Data Source. You will notice that there are five new buttons. 5. If you selected PS Query. A plug-in for MS Word can be downloaded from Oracle’s website or PeopleSoft application.Report template can be created using MS Word. Step 2 – Report Template Let’s create an RTF template using XML file that you created in step 1. Data and Load XML file that you created in step 1. Add a new Data Source. Definition – Specify description and category of report. Youc can click on ‘Generate’ button to create Sample XML file to be used in report template. Save XML file on your PC. 2. Save the template. Step 3 – Report Definition You are ready to create report definition. 4. There are five tabs in Report Definition. You can format your report and test it using the loaded data. XML Publisher Engine takes data source and template and creates a report. Now your sample data is loaded in the template.e. Use functions GetXMLData and GetXSDSchema to generate XML file and XSD file for rowset. first create a Query that you wish to use in your report. Save the report definition. Try it out and email me if you have any questions info@. Go to http://www. FIELDVALUE XLATSHORTNAME ---------1 2 3 4 5 6 7 8 9 10 11 ------------Cancel Delete Error Hold Queued Initiated Processing Cancelled Success No Success Posted . here are the values corresponding to each value. Remember the output of XML Publisher report does not go to Process Monitor. you need to go to Report Manager. Your first XML Publisher report is ready.com/ for more help.gravitonconsulting.gravitonconsulting. Step 4 – Process Definition Write a small Application Engine program that runs the above report definition. In order to see the report.com Peoplesoft Administration Process Scheduler Run Status (RUNSTATUS) Values Process scheduler status is stored as numeric values behind the RUNSTATUS field. So. Now create a new process definition that runs this Application Engine process. ROLENAME = RU. Stay with the Permission List. this will show which Permission List is giving you access to the Report to Window functionality. To assign permission to run a report ‘to window’ there are 2 steps to follow: 1) Look on the PeopleTools tab of the Permission List and click on Realtime Event Notification Permissions and check ‘Reporting Window’ has ‘Full Access’.ROLEUSER . if you wish to use SQL. RU.ROLEUSER . but then some HTML/JavaScript is loaded from the REN Server itself.CLASSID .ROLENAME .CLASSID AND AI. it is PTPT1200. AI.CLASSID = RC. PSAUTHITEM AI WHERE RC. saving them the effort of repeatedly clicking on the Refresh button in Process Monitor. RC.Over View The REN Server is a seperate Web Server designed to publish Real-time Event Notifications to users. By default. If you wish to use SQL. Again.CLASSID . PSROLEUSER RU . You need to give WEBLIB_RPT Full Access to the iScript. RU.ROLENAME AND RU.BARNAME = 'REPORTING' 2) You’ll also need access to the iScript.ROLENAME . The Popup window you see when running a process ‘to window’ is originally an HTML area populated/called from an iScript. this will show you the Permission list that is giving you access: SELECT RU.AUTHORIZEDACTIONS FROM PSROLECLASS RC .ROLEUSER = 'PTDMO' AND AI. RC. AI. SELECT RU.AUTHORIZEDACTIONS .12 13 14 15 16 Not Posted Resend Posting Generated Pending Ren Server -. and look on the Web Libraries tab. The code I added all went into PORTAL_CSS. I know all that already. . • and of course the option to boot the PSRENSRV process or not is set using PSAdmin • there is also a psrenconfig.MENUNAME = 'WEBLIB_RPT' AND AI.CREFPERM. SSL and host machine). Unless you need Clustering/Failover or a Reverse Proxy Server there isn’t much to configure.ROLEUSER = 'PTDMO' AND AI. "HH:mm:ss") | ")". It’s a method that lets you inject HTML into the REN Server window and it sounded like an ideal method of giving users feedback on the progress of their process/report.txt under the App Server directory. wherever I wanted to update the user of the status. yes.CLASSID = RC. I’ll wager you didn’t know this … • The neatest trick that drew my attention to the ‘NotifyToWindow’ method of the PrcsApi class.PNLITEMNAME = 'IScript_GetReport' Now that security is covered you might think that there’s not a huge amount to talk about with the REN Server as in some ways it’s a bit of a ‘black box’.cfg (logging levels. but I’ve never needed to mess with these settings Yes. PSROLEUSER RU . Tell me something I don’t know.CLASSID AND AI.FROM PSROLECLASS RC .ROLENAME = RU. Then. There are some settings in the psappsrv. you say.Step1 and was as follows: At the top: import PT_PRCS:API:*. not anywhere important) and gave it a whirl. (" | DateTimeToLocalizedString(%Datetime. Ok.BARNAME = 'ISCRIPT1' AND AI. To give it a quick try I added some code to the PORTAL_CSS App Engine (in a play environment obviously.ROLENAME AND RU. PSAUTHITEM AI WHERE RC. ports and authentication token domain). It’s one of those little gems that’s tucked away in PeopleBooks that I’d never noticed before. After the functions (about half way down): Local PT_PRCS:API:PrcsApi &api = create PT_PRCS:API:PrcsApi(). • and some settings under PeopleTools in the PIA (client authentication. I added the following: &strl_WindowMsg = &strl_WindowMsg | "<br />Step 1/5: Portal Security Sync starting. The resulting REN Window looked as follows: I’ve only output static text to the window.notifyToWindow(AEPORTALCSS_AET. How can you set the number of links available under a Portal folder? Navigate to PeopleTools > Portal > Portal Utilities > System Options and update "Maximum Child Links" to 4. but there are further possibilities.&nret = &api. If you are wondering why 4 links and not 6 or 10 links.PROCESS_INSTANCE.. well. placed my messages at reasonable points in the process and ran it.. it is 4 links because this is what I want it to be. link). I’d be interested to hear from anyone with good ideas on how to use this. You can also notice that each sub-folder has 4 more links listed below it (in addition to the More. Set Number of Links within the Portal Navigation The picture below shows a Security folder and 2 sub-folders (User Profiles and Permissions & Roles). . &strl_WindowMsg). 48). hit ‘Next’ button. It’s an easy-to-use eight step process. port type. These are easily accessible via standard HTTP and HTTPS protocols. 5. Chose all methods that you need for PeopleSoft and hit Next button. Consume a Web Service. Check WSDL URL radio button and enter Web Service URL. Legacy WSDL (Prior to 8. This next screen will show you the name of WSDL service. WSDL URL. 8. You’ll see five options: UDDI. Use the following steps: 1. It also allows PeopleSoft to use Web services made available by different systems. it’s very easy to setup Web Services in PeopleSoft. 7. Select the serviceby checking the box. Hit the ‘Next’ button after you are done with step 5.Very easy to setup and it could make a big visual difference for your users. WSIL URL. After selecting the port. Integration Broker . Hit the ‘Next’ button which will take you to step 3. . In this article I am going to explain how to consume web services in PeopleSoft: Consume Web Service PeopleSoft provides a Wizard to consume Web services. WSDL and XML. etc. In this screen you may see more than one port of the Web service. If the method that you selected above is a Synchronous Operation that it will take you directly to Step 6. Web Services . Web services in PeopleSoft gives you the ability to expose PeopleSoft functions and methods to the outside world over HTTP. 2. 6. In this step. 4. Click ‘Next’ button. If you would like to see the service WSDL. Setup Web Services in PeopleSoft PeopleSoft Web Services – Consume Web Service Web services is a collection of programming techniques including SOAP. This screen gives a lot of details about the methods such as method type. They are platform indepent. you will be able to select all functions/methods that are provided by Web service. It takes you step number four. Go to PeopleTools . If the method is Asynchronous then it will take you to Step 5 where you will be able to convert two Asynchronous messages to one Synchronous message. We are going to use WSDL URL assuming that you have the URL of the Web service that you are trying to use. 3. You just need to select one port. File. How to setup Web Services in PeopleSoft With the basic understanding of Integration Broker. click View WSDL hyperlink. view and delete attachments! .. follow the steps below to find how to view Service Operation that you just created. Go to PeopleTools . The final page is the Consume Web Service Confirm page.Integration Setup . Just navigate to PeopleTools > Utilities > Debug > PeopleTools Test Utilities to get the component and page name (Ctrl+J). Step 8 allows you to assign an existing or a new node to your Service Operation. Type in the service name that you had created in Step 6. If your web service has an asynchronous message then it takes you to Step 7. View web service in Integration Broker Now you are done with ‘Consume a Web Service’. From step 6 you can be directed to either step 7 or step 8. Open Application Designer and start looking at the code. In order to view the components of the consumed web service you can go to Integration Setup under PeopleTools.com/ for more information.gravitonconsulting. 10. That same code could be used on your own custom page to allow users to upload. In this step you assign a Queue to your Service Operation. You can create a new queue or assign an existing one.9. You can also view the Service Operation associated with it. Go to http://www. 1. There is ‘View WSDL’ hyperlink that you can use to view the consumed WSDL document. There you see WSDL Import log which provides the summary.com Upload Files in PeopleSoft (File Attachment) I will not be giving any sample code in this post BUT I will show you the way to find the code. It will open the Service details. PeopleSoft automically assigns messsage names but you can change them to more meaningful names. When you go to step 6. If you are not familiar with Integration Setup. Click the Finish button to proceed to the next step in the Wizard.gravitonconsulting. 11.Services 2. 3. 12. You can also view the consumed web service. Code that is delivered by PeopleSoft and does a little bit more that just uploading a file! The code will show you how to View and Delete uploaded files as well. If you need more assistance. email me : info@. Now you are in Step 6 which allows you to convert Web service methods to PeopleSoft Service Operations messages. . the only section that matters for us on the page is the "File Attachment Test". you need to be familiar with the terminology used for Web services. In this post.The PeopleTools Test Utilities page is also used to test for Java calls. enabling the definition. Extensible Markup Language (XML): XML is a text-based format that provides a mechanism to describe document structures using markup tags. validation. It allows developers to create their own customized tags. Common Terminology Used in Web Services Before start using PeopleSoft Integration Broker for sending and receiving services. XML Schema Definition (XSD): XSD is a way to describe and validate data in an XML environment. You can think of a schema as a model for describing the structure of information. WSDL not only describe the message content but also defines where the service is available and what communicates protocol to use to communicate with that service. In short. Namespaces prevent identically custom-named tags that may be used in different XML documents from being read the same way. the WSDL file defines every thing needed so that developers can write a program to work with an XML Web Service. This is outside the topic of this post. and interpretation of data between applications and between organizations. transmission. XSD makes it easier to validate documents based on namespaces. I will try to list and describe common terms used for Web services. Web Services Definition Language (WSDL): WSDL is an XML-based language used to describe services provided by a business and defines how other businesses can access those services electronically. Simple Object Access Protocol (SOAP): SOAP is a way for programs running in different or same operating systems to communicate with one another buy using the World Wide Web’s Hypertext Transfer Protocol (HTTP) and XML. Web Services Inspection Language (WSIL) specification provides an XML format for assisting in the inspection of a site for available services and a collection of rules for how inspection related information should be made available for consumption. location. Universal Description..[People Code Debugger] . Discovery. • Port Number should be WSL port number. yellow. Settings for PSAPPSRV . • Enter Application Server Name • Machine Name or IP Address should be your machine IP address on which application server domain resides.cfg: .. and Integration (UDDI): UDDI as described by PeopleSoft "is an XML-based registry for businesses worldwide to list services on the Internet. product.CFG file Location: \\PS_HOME\appserv\DomainName\ Psappsrv. and green pages. Its ultimate goal is to streamline online transactions by enabling companies to find one another on the Web and make their systems interoperable for e-commerce." Debugging Functionality in Peoplesoft Open Configuration Manager -> Profile ->Create. • Select Connection Type as Application Server.————————————————————————PSDBGSRV Listener Port=15000 . Bring the following changes in your PSAPPSRV. UDDI is often compared to a telephone book's white. Turn on Debugger Service. [PSAPPSRV] . ================================================== ======================= .. UDDI allows businesses to list themselves by name. or the Web services they offer. ————————————————————————. It is usually helpful because it becomes it's quite easy and you don’t have to hard code user id and passwords in SQR. ================================================== ======================= . PeopleTools comes with FTPTARGET connector that can be used to GET and PUT the files. Setup the node using these instructions: Go to PeopleTools . Create FTP GET node: This node will be used to download the file from FTP server. Make sure that node type is ‘External’ and it’s an Active node. and start the application server domain. Check whether the PC Debugger feature is enabled or not. Integration Broker .. Make it yes. Integration Setup. • Login into Application Designer and PIA with same User ID Go To Application DesignerDebugSelect PeopleCode Debugger Mode Press ctrl+F9 to set the Break Points Press F5 to run the execution of program FTP Files in PeopleSoft PeopleSoft Integration Broker – FTP Files This article explains how you can download files from FTP servers using Integration Broker. We are going to use Integration Broker technology to FTP files. . PC Debugger should be set to yes. Nodes. Add a new node called FILE_FTP_GET_NODE. Download file from FTP server: 1. Application Engine or PeopleCode. You can follow the steps below to play around with the files. UBBGEN settings Min Instances=2 Give >= 2 Max Instances=2 Service Timeout=0 Give >= 2 Go to PSADMIN -> Quick Configuration. Connector properties will be populated automatically. Save it. Use the above services as Request and Response in your service operation. Create Routing: Go to Routing tab of FILE_FTP_GET_OPR service operation and add a new routing called: FILE_FTP_GET_RTG. Uncheck it. You may add other properties for example ‘DIRECTORY’ to mention the folder where file resides. Make sure that the routing is activated. specify ‘PSFT_EP’ or your local node as ‘Sender Node’ and ‘FILE_FTP_GET_NODE’ as your 'Receiver Node'. Write PeopleCode to use the above setup. In the routing definition.gravitonconsulting. Locate the second box on the page and there you should see a check box that says "Display search in navigation". clear cache and sign back in. Now your integration broker setup for FTP the file is ready. password (encrypted). If you need more assistance. Enter all the required fields such as hostname. Create Service Operation: Now create a Synchronous Service Operation. if you don't. 2. You can even write Request and Response handlers. It must be easy to do. . In Connector Id field. Now add a new synchronous Service Operation called: FILE_FTP_GET_OPR. It will use two Services.Go to Connectors tab and enter Gateway Id ‘Local’. select ‘FTPTARGET’ by clicking magnifying glass. right? Well yes and no. userid.com/ for more help. Let’s create two non-rowset services called: FTP_RQST_SVC and FTP_RESP_SVC. search box is gone. You may also specify name of the file using ‘FILENAME’ property. and No. email me: INFO@GRAVTIONCONSULTING. Enter ‘GET’ for method property. 3. Yes. Voila. Move or Hide Portal Search Box Part of our upgrade requirement is to hide the search box on the navigation menu as we are not using it. if you know where to go. Save the node. You may write code in Application Engine or behind a push button.COM Go to http://www. This is to tell the node that we are downloading the file. It will just take some time to dig around to find the right place to turn it off (Hide it). To hide the search box navigate to: Root >> PeopleTools >> Portal >> General Settings. etc. com.Notice the adjacent check box "Display search in header". . Using the search box on the header instead of the left navigation menu might save you some space! Peoplecode Dynamic Drop Down(Translate Values) This code i have got Ittool box. then the search box would be moved from the left menu (default location) to the Header. if you check this one. Give it a try to see how would that look. AddDropDownItem(" ".It is very useful.AddDropDownItem("A".APPROVAL_STATUS. /*Loop through the array*/ For &I = 1 To &aRoles.AddDropDownItem("H". I hope this will help everybody if needed. &fField. &fField. Local Field &fField. &fField = Record. /*Returns an array containing all roles associated to the current user*/ &aRoles = %Roles. Here is an example on the page activate PeopleCode. "Hold"). &fField.EX_APR_WRK. "All"). .Len &RoleName = &aRoles.AddDropDownItem("D". &bFound = False.ClearDropDownItem(). "Approved"). "Denied"). In this case we can use AddDropDownItem(). Check for User Role A very handy PeopleCode function to check for a user role(s) and perform specific actions depending on the value returned.ClearDropDownList(). The fact is that we need to use ClearDropDownItem() function first. Function RoleToMatch(&RoleToMatch) Returns boolean. so whatever values it had will be cleared out and then we will have to manually add values using AddDropDownItem(). &fField. &fField.Shift(). we usually have requirement when we want to hide some translate values from translate field on page for some business reason. If Upper(LTrim(RTrim(&RoleName))) = Upper(LTrim(RTrim(&RoleToMatch))) Then &bFound = True. . End-If. Local string &RoleName.. The code below should help you out and get you started! /*The path to the files you need to delete*/ &oldFilesPath = "/my_directory/my_folder". This means any file that starts with "file_name" will be deleted*/ &oldFiles = "file_name" | "*". /*Function Call*/ /*The role that I would like to validate if a user has is "Administrator"*/ If RoleToMatch("Administrator") Then /*What you want to do goes here*/ End-If. Delete Multiple Files Using PeopleCode Deleting files sitting on a server using PeopleCode is one thing I'm sure you will be doing sometime during your PeopleSoft career. Return &bFound. Local boolean &bFound. /*Notice the "*" at the end of the file name. . Local number &I.and here is how to call the function /*Note: Don't forget to declare your function before you call it*/ /* Declare variables &aRoles is an array of string that will store roles from %roles */ Local array of string &aRoles. End-For.Break. End-Function.. End-If.. If (&retcode = %Attachment_Failed) Then MessageBox(0. 0. &deleteFile). "File Attachment Status". &oldFileNames = FindFiles(&PathAndName. "Deleted file: " | &deleteFile). "DeleteAttachment cancelled"). 0./. 0. End-While. /*Display file path and name deleted */ &retcode = DeleteAttachment(URL. MessageBox(0. 0. 0. If (&retcode = %Attachment_FileTransferFailed) Then MessageBox(0./." | &oldFileNames. 0.Shift(). End-If. 0. "File Attachment Status"./. "File Attachment Status". Delete PeopleSoft Query From the Database .. "". 0. 0. %FilePath_Absolute). End-If. "DeleteAttachment succeeded"). 0. If (&retcode = %Attachment_Cancelled) Then MessageBox(0. 0.. "DeleteAttachment failed: File Transfer did not succeed"). "File Attachment Status".Len > 0/* Delete files one at a time */ &deleteFile = ". /*Loop through files found and delete one by one */ While &oldFileNames. "DeleteAttachment failed"). /*Display file path and name to be deleted */ MessageBox(0.&PathAndName = &oldFilesPath | &oldFiles. 0. "Delete file: " | &PathAndName).. End-If. "". /*Check delete status*/ If (&retcode = %Attachment_Success) Then MessageBox(0. Upgrade clean up would probably be the most common one. SQLExec("DELETE FROM PSQRYEXPR WHERE QRYNAME=:1". &sQueryName). SQLExec("DELETE FROM PSQRYRECORD WHERE QRYNAME=:1". SQLExec("DELETE FROM PSQRYBIND WHERE QRYNAME=:1". . Delete a File Using PeopleCode It is always a good idea to check for a file if exists before trying to delete it. SQLExec("DELETE FROM PSQRYCRITERIA WHERE QRYNAME=:1". SQLExec("DELETE FROM PSQRYFAVORITES WHERE QRYNAME=:1". The code below also checks for the returned code by the function to verify whether the file has been deleted or not. The delete is performed using the build-in peoplecode function DeleteAttachment. &sQueryName). &sQueryName). deleting by Query Name is not the only available option. So the code below will check for that and then will attempt to delete the file if found. SQLExec("DELETE FROM PSQRYSELECT WHERE QRYNAME=:1". SQLExec("DELETE FROM PSQRYEXECLOG WHERE QRYNAME=:1". Function DeleteQuery(&sQueryName As string) SQLExec("DELETE FROM PSQRYDEFN WHERE QRYNAME=:1". &sQueryName). &sQueryName). &sQueryName). &sQueryName). End-Function. &sQueryName). SQLExec("DELETE FROM PSQRYFIELDLANG WHERE QRYNAME=:1". &sQueryName). SQLExec("DELETE FROM PSQRYFIELD WHERE QRYNAME=:1". &retcode = DeleteAttachment(URL. Of course.BKFTP. ATTACHSYSFILENAME). &sQueryName). So. &sQueryName). &sQueryName).There could be different reasons why a PeopleSoft developer would like to delete a query from the database. /*Below tables are not availabe in older PS versions*/ SQLExec("DELETE FROM PSQRYSTATS WHERE QRYNAME=:1". SQLExec("DELETE FROM PSQRYBINDLANG WHERE QRYNAME=:1". Here is a function you can use to get you started. feel free to modify the function to fit your needs. ATTACHUSERFILE = “”. If (&retcode = %Attachment_Failed) Then MessageBox(0. Hide(ATTACHDELETE). “DeleteAttachment cancelled”). “DeleteAttachment failed: File Transfer did not succeed”). 0. 0. 0. If (&retcode = %Attachment_FileTransferFailed) Then MessageBox(0. End-If. 0. “File Attachment Status”. “DeleteAttachment failed: No disk space on the web server”). “DeleteAttachment failed: No disk space on the app server”). 0. 0. 0. 0. . If (&retcode = %Attachment_Cancelled) Then MessageBox(0. “DeleteAttachment failed”). “File Attachment Status”. 0. End-If. “File Attachment Status”. 0. “File Attachment Status”. /* following error message only in PeopleSoft Pure Internet Architecture */ If (&retcode = %Attachment_NoDiskSpaceAppServ) Then MessageBox(0. 0. “File Attachment Status”. “DeleteAttachment succeeded”). ATTACHSYSFILENAME = “”. UnHide(ATTACHADD). 0. /* following error message only in PeopleSoft Pure Internet Architecture */ If (&retcode = %Attachment_NoDiskSpaceWebServ) Then MessageBox(0. “File Attachment Status”. End-If. Hide(ATTACHVIEW).If (&retcode = %Attachment_Success) Then MessageBox(0. End-If. End-If. If (&retcode = %Attachment_FileExceedsMaxSize) Then MessageBox(0. “File Attachment Status”. If (&retcode = %Attachment_DestSystNotFound) Then MessageBox(0.SOCIAL_SECURITY_NUMBER. SSN on a page should show up as xxx-xx-5623 Dynamic Prompt Table Depending on a Drop Down Value In this post I will attempt to explain how to dynamically assign a prompt table depending on a drop down value (see image below) . DERIVED_HR. “XXX-XX-”). starts at position 1 and replaces the 1st 7 characters with the string “xxx-xx-”. Display Only the Last 4 Digits of a Social Security Number The PeopleCode below will only display the last 4 digits of a social security number. End-If. 1.SOCIAL_SECURITY_NUMBER = Replace(DERIVED_HR. End-If. 0. “DeleteAttachment failed: Cannot locate destination system for ftp”). “DeleteAttachment failed: File exceeds the max size”). “File Attachment Status”. The functions takes the value from a the above field. End-If. 0. “DeleteAttachment failed: Unable to login into destination system for ftp”). Here. 7. 0.End-If. I’m using the replace PeopleCode built-in function. 0. The result: After this code gets executed. 0. 0. “File Attachment Status”. I have placed the code in a Component PostBuild event and it works perfect. If (&retcode = %Attachment_DestSysFailedLogin) Then MessageBox(0. EDITTABLE = "PSCLASSDEFN_SRC".Value. Now.EDITTABLE = "PSROLEDEFN_SRCH". FTP a File Using PeopleCode Here is a function to FTP a file on a server using PeopleCode. Break. The PORTAL_AUTHNAME is the "Name" column you see on the grid.CLASSDEFNDESC.The table behind the grid is PORTAL_SECDYVW and as you can see from the image below. When "R" DERIVED.PORTAL_AUTHNAME. PORTAL_SECDYVW. Local string &FtpPassword.Value. PORTAL_SECDYVW. . we would want to assign table PSCLASSDEFN_SRC as prompt if the drop down value is Permission list and PSROLEDEFN_SRCH if the value is Role.PORTAL_PERMTYPE2 When "P" DERIVED.FieldChange*/ Evaluate PORTAL_SECDYVW. the PORTAL_AUTHNAME field has %EDITTABLE defined as a prompt table. /*Record PeopleCode: PORTAL_SECDYVW.DESCR.DESCR = PSCLASSDEFN. When-Other End-Evaluate.DESCR = PSROLEDEFN. Break. Local string &FtpUserID. Search for AddAttachment function. “File Attachment Status”. /*** It is always a good practice to check to see if local file exists before trying to transfer it ***/ If FileExists(&FILEPATHNAME. /* Set ftp string */ &Ftp_my_file = “ftp://” | &FtpUserID | “:” | &FtpPassword | “@” | &FtpURL. 0. Please refer to PeopleCode Reference for Return Code description. When-Other MessageBox(0. “File transfer succeeded”). 0. End-Evaluate. /* make sure to check the retcode by the built-in PeopleCode function PutAttachment to get the result of your ftp attempt */ Evaluate &RetCode When %Attachment_Success MessageBox(0. &FtpPassword = “password”. 0. &FILEPATHNAME). Break. Function ftp_file. &targetFile. “File transfer failed. Return Code is ” | &RetCode | “. 0. “File Attachment Status”.Local string &FtpURL. Break. . 0. “File Attachment Status”. “File transfer failed”). &FtpUserID = “user_id”. %FilePath_Absolute) Then /*** Sending file… FILEFATHNAME is the path and the name of the file. while targetFile can be used to change the name of the file if need be ***/ &RetCode = PutAttachment(&Ftp_my_file. &targetFile = “File_Name”. &FtpURL = “directory_name/subdirectory_name”.”). 0. When %Attachment_Failed MessageBox(0. &FIELDLEN = Len(&FIELDVALUE). &FIELDVALUE = String(&FIELDVALUE). &FIELDVALUE. End-Function.&FIELDVALUE: The value you want to append the character to. &RESULTFIELD). &FIELDVALUE. fieldsize parameter. 0.&FIELDLEN. The function takes three parameters: . /*Example calling the above function*/ &CHAR = "0". &FIELDFILL = &FIELDSIZE . “File Status”. . /*this function accepts a character value. End-Function.”). &FIELDVALUE = 7.&LEADCHAR: The character you want to append to your value. . &FIELDFILL). &FIELDSIZE. 1). . The result is passed back in a result field. 0. Function to Add Leading Characters to a Value or Field A function to facilitate the addition of a leading character to a field value. &RESULTFIELD). Function add_leading_char(&LEADCHAR.*/ &LEADCHAR = Left(&LEADCHAR. “File ” | &FILEPATHNAME | ” doesn’t exist.&FIELDZISE: The over all size of your value after appending your desired character. add_leading_char(&CHAR. &FIELDSIZE. and a field value parameter and adds a leading character up to the size of the field. FTP transfer Failed.Else MessageBox(0. &FIELDSIZE = 5. End-If. &RESULTFIELD = &LEFT_HALF | &FIELDVALUE. &LEFT_HALF = Rept(&LEADCHAR. GetRow(&J).GetRow(&J). &DAY_INCREMENT). month or day.RowCount &level2fieldvalue = &rs_level2. the &RESULTFIELD value would be equal to 00007*/ Function to Increment a Date Field The function increments a date field using the AddToDate function and sets a weekday field to the corresponding weekday. &YEAR_INCREMENT.GetRow(1). &WEEKDAY.Level0_field. .(1).Level2_Record. &row_level0 = &rs_level0. Generic Scroll PeopleCode We always find it confusing to write code for Scrolls. Following is generic peoplecode which you can use for pages having parent child relationships (scrolls). &MONTH_INCREMENT. End-Function. &rs_level1 = &row_level0.Level2_Record). &rs_level0 = GetLevel0().Value End-For. You can increment date value by year.Level1_Record). Function increment_date(&DATE. End-If. &YEAR_INC.Value . If All(&DATE) Then &DATE = AddToDate(&DATE.Value &row_level1 = &rs_level1.Level1_Record. For &J = 1 To &rs_level1. /*get day value for the incremented date*/ &WEEKDAY = String(Weekday(&DATE)). For &L = 1 To &rs_level2.GetRowset(Scroll.RowCount &level1fieldvalue = &rs_level1.Level2_field. &MONTH_INC. &level0fieldvalue = &rs_level0.GetRow(&L).Level1_field./*after execution.GetRowset(Scroll.Level0_Record. &rs_level2 = &row_level1. Just replace the record and field for respective level. &DAY_INC). How to Add Items to a Drop Down List? The PeopleCode below will do couple things.End-For. "/"). Second.0 = role not found. Get PeopleSoft Home (PS_HOME) Using PeopleCode PeopleCode to get PS Home from your server: &PS_HOME = LTrim(RTrim(GetEnv("PS_HOME"). "/"). PERSON_ADDRESS. &role_found = %RolesFind("Your_Role"). then hid the fields. The role doesn't have to have any permission list(s).activate PeopleCode event. The only way that I know of is by creating a new role and assigns it to users who should not be seeing the fields. /* Hide Rows on the grid for any thing that is not of Address Type "HOME" */ FOR &i = 1 TO &Level1. allow users to only be able to add a "Home" mailing address by restricting the values in the drop down list to show only "Home" by using the ClearDropDownList and AddDropDownItem properties. There is a delivered PeopleSoft function that checks if a user has a specific role. although it could if you want to. First. it really doesn't matter for what we are trying to do here. In the page. it will restrict grid on a page to show only rows of address type "HOME". If so.PERSON_ADDRESS. End-If. right some code to test if the user opening the page is in that role. If &role_found <> 0 Then rem -. Easy and straight to the point Hide Fields on PeopleSoft Page for Some Users Sometimes you would like to hide fields from some users and not others. .ActiveRowCount &AddrType = FetchValue(Scroll. &i.ADDRESS_TYPE).hide your fields. This is how to go about doing that: Create a role and add the users that should not see the fields to this role. rem -. End-IF. this code resolves to: . "Home").ClearDropDownList(). The following PeopleCode uses the %Concat meta-sql meta-variable: SELECT INSTRUCTOR.ADDR_TYPE_DESCR.ADDR_TYPE_DESCR. so restrict the values in the drop down to show only "Home"*/ IF &addrHomeFound = "Y" Then /* home mailing address already there. %Concat Meta-SQL in PeopleCode %Concat resolves to the database-specific concatenation operator so you don't have to guess which way it is done. Else /* Clear drop down list and then show only "Home" */ DERIVED_CO. no need to show the drop down menu */ DERIVED_CO. /*Users will only be able to add a "Home" mailing address. FIRST_NAME %Concat ' ' %Concat LAST_NAME FROM %Table(PSU_INSTR_TBL) On SQL Server. End-IF. End-FOR. FIRST_NAME + ' ' + LAST_NAME FROM PS_PSU_INSTR_TBL On Oracle. this code resolves to: SELECT INSTRUCTOR.Visible = False.AddDropDownItem("HOME". Else &addrHomeFound = "Y".Visible = False.IF &AddrType <> "HOME" Then &Level1(&i). this code resolves to: On SQL Server. DERIVED_CO.ADDR_TYPE_DESCR. And here is an example: SELECT 'X' FROM dual WHERE sysdate > %CurrentDateIn. as_of_date) The %EffDtCheck construct expands into an effective date subquery suitable for a Where clause. recordname: Specify the record name to use as the record in the effective-date checking. a record object. This can be bind variable. FIRST_NAME || ' ' || LAST_NAME FROM PS_PSU_INSTR_TBL %CurrentDateIn Meta-SQL Function A very useful PeopleCode Meta-SQL function. this is how PeopleSoft explains it: The %CurrentDateIn meta-SQL variable expands to a platform-specific SQL substring representing the current date in the Where clause of a SQL Select or Update statement. %EffDtCheck PeopleCode Built-in Function Effective dated quires are used often in PeopleSoft and a great build-in function that will save you time is the %EffDtCheck.SELECT INSTRUCTOR. I will be providing an example and how %CurrentDateIn function will be resolved at run time. correlation_id2. or when the current date is passed in an Insert statement. the SQL above will be resolved to look like this: SELECT 'X' FROM dual WHERE sysdate > To_Date(To_Char(SYSDATE. At run time. or a record name in the form recname. Lets take a closer look! Syntax %EffDtCheck(recordname [correlation_id1]. But first. 'YYYY-MM-DD'). . 'YYYY-MM-DD'). a variable. This can be a bind variable.KEYFIELD1 = correlation_id. .KEYFIELD1 AND recordname. If this parameter isn’t specified.FNUM .EFFDT <= %DATEIN(as_of_date)) In the following example.correlation_id1: (Optional) Specify the letter used inside the effective-dating subselect. . . :2)". WHERE %EffDtCheck(recordname correlation_id. &Date). correlation_id2: Specify the letter already assigned to the main record in the From clause of the SQL statement. A. . SQLExec("SELECT FNUM FROM PS_REC A WHERE %EffDtCheck(:1. as_of_date: Specify the date to use in the effective date.KEYFIELD2 AND. . &Rec. . . as_of_date) The example code resolves into the following: SELECT . The value for as_of_date is automatically wrapped in%DateIn unless as_of_date is already wrapped in %DateIn or refers to other database columns. This example code resolves into the following: "Select FNUM from PS_REC A where EFFDT = (select MAX(EFFDT) from PS_REC where PS_REC. Here are some examples from PeopleSoft books: The following is a generic code sample: SELECT. . . FROM. AND recordname. &Date has the value of 01/02/1998.KEYFIELD2 = correlation_id. .FNUM = A. FROM. WHERE correlation_id. or a hard-coded date. recordname is used. The example &Rec object has an EFFDT key field.EFFDT = (SELECT MAX(EFFDT) FROM recordname WHERE recordname. EFFDT <=%CurrentDateIn) AND A.EFF_STATUS = ’A’ To know list of Peoplesoft System catalog tables: SELECT table_name FROM all_tables WHERE owner = 'SYSTEM' – Schama_name AND NOT REGEXP_LIKE (table_name.EFFDT = (SELECT MAX(B. A.and PS_REC. '^PS(_)') AND REGEXP_LIKE (table_name. %CurrentDateIn) AND A.DEPTID AND B. '^PS').DEPTID FROM %Table(DEPT_TBL) A WHERE %EffDtCheck(DEPT_TBL B.SETID AND A.DEPTID = B.EFFDT) FROM DEPT_TBL B WHERE A. =+ .EFFDT <= %DateIn(’1998-01-02’) )" The following example uses correlation IDs: SELECT A.SETID = B.EFF_STATUS = ’A’ This example code resolves into the following: SELECT A.DEPTID FROM %Table(DEPT_TBL) A WHERE A. Used to find the Workgroup. Needs to be in sync with PS_JOB data. of an employee. EMPL_RCD. EMPL_RCD. Final target table of the timesheet component. Active status. SEQ_NBR. Keys: EMPLID. TL_PAYABLE_TIME Contains final processed time ready to be sent to a Payroll System. The PS_JOB of Time and Labor. TL_RPTD_TIME The single most important transaction table in Time and Labor. Other important fields – TRC. Both Punch and Elapsed data reside in this table – distinguished by the PUNCH_TYPE field. DUR and SEQ_NBR. Taskgroup. RT_SOURCE. Other important fields – TRC. Taskgroup and Time Reporter Status. Has an audit table – AUDIT_TLRPTTIME. Key: EMPLID. EMPL_RCD. Time Reporter Type. TL_QUANTITY.My Top 6 Tables in Peoplesoft Time and Labor . DUR. EFFDT. Timezone etc.Presentation Transcript Top 6 tables in Peoplesoft Time and Labor Jiju Cherian Vengal TESCO TL_EMPL_DATA Maps data between EMPLID and T&L parameters like Workgroup. Holds all data regarding the time reported by employees. PAYABLE_STATUS. PAYROLL_REQ_NUM. . Keys: EMPLID. Output of the Time Administration process and has the TL_RPTD_TIME as the source. Found under the Enroll Time Reporters component. TL_QUANTITY. TL_TR_STATUS Table used by the Time Administration process to determine the employees to be processed. =+ . TL_IPT Intermediary Payable Time tables – IPT tables are the most important temporary tables in Time Administration processing. TL_PAYABLE_TIME data is populated from TL_IPT1 table at the end of rule processing. Data from reported time and scheduling tables are populated in TL_IPT1. All exceptions with an ‘Archive’ flag on will remain in the TL_EXCEPTION table after the exception is resolved. TL_EXCEPTION Transaction table containing the details of all exceptions that are generated. Keys – EMPLID. Not externalised through any component – updated by the Time Administration process and Peoplecode in various components including timesheet. TA_STATUS. allowed (A) or changed (A). EMPL_RCD. All High Severity exceptions will have to be resolved for payable time to be generated.To be used for custom reports and interfaces requiring to take the final output in Time and Labor. unresolved (U) . Exception_Status field tells whether the exception is resolved (R). Other important fields – EARLIEST_CHGDT. Extensively used by almost all T&L rules where data is transferred from one IPT table to another for rule processing.
Copyright © 2024 DOKUMEN.SITE Inc.