isuserinrole peoplesoft

isuserinrole peoplesoft

isuserinrole peoplesoft is peoplecode function check whether user belongs to a role through peoplecode.

Syntax: IsUserInRole(rolename1 [, rolename2]. . .)

Return a Boolean value:
True if the current user belongs to one or more of the roles in the user role array,
False otherwise

For example 1:

&CheckFlag =  IsUserInRole(“ROLE_NAME”)

&CheckFlag contains true if the currnet user has ROLE_NAME in his profile.

 

For example 2:

 

References:

http://peoplesoft-erp-hcm.blogspot.com/2012/12/check-whether-user-belongs-to-role.html

https://docs.oracle.com/cd/E13292_01/pt849pbr0/eng/psbooks/tpcl/chapter.htm?File=tpcl/htm/tpcl02.htm

%mode peoplesoft

%mode peoplesoft

%mode peoplesoft returns a String value consisting of an uppercase character specifying the action a user selected when starting the current component. The following values can be returned. You can check either for the string value (“A”, “U”, and so on.) or for the constant:

Numeric Value

Constant Value

Description

A

%Action_Add

Add

U

%Action_UpdateDisplay

Update/Display

L

%Action_UpdateDisplayAll

Update/Display All

C

%Action_Correction

Correction

E

%Action_DataEntry

Data Entry

P

%Action_Prompt

Prompt

 

Refererence: https://docs.oracle.com/cd/E26239_01/pt851h3/eng/psbooks/tpcl/chapter.htm?File=tpcl/htm/tpcl04.htm

Types of Record in PeopleSoft

Types of Record in PeopleSoft

Types of Record in PeopleSoft. The values for the RECTYPE field in the PSRECDEFN that stores the information about the records in PeopleSoft.

  • 0 = SQL Table
  • 1 = SQL View
  • 2 = Work Record
  • 3 = Subrecord
  • 5 = Dynamic View
  • 6 = Query View
  • 7 = Temp Table

For example sql, you can do something like this to find all the tables that have the OPRID field:

 

Reference: https://psst0101.wordpress.com/2010/04/07/record-type-values/

Peoplesoft Tables

Peoplesoft Tables

Peoplesoft Tables Lists.

Projects

PSPROJECTDEFN — Project header table
PSPROJECTITEM — Definitions in the project

Fields

PSDBFIELD — Fields in the system
PSXLATITEM — Translate Values

Records

PSRECDEFN — Record header table (record types)
PSRECFIELD — Fields in the record (subrecords not expanded)
PSRECFIELDALL — Fields in the record (subrecords expanded)
PSKEYDEFN — Indexes
PSTBLSPCCAT — Tablespaces
PSRECTBLSPC — Records’ tablespace assignments

Pages

(Note: Pages still have the name panels in the PeopleTools table names)
PSPNLDEFN — Page header table
PSPNLFIELD — Page controls (field types/FIELDTYPE)
PSPNLHTMLAREA — Static HTML Areas on Pages
PSPNLCNTRLDATA — stores additional attributes for Page controls
PSPNLFIELDEXT — stores additional attributes for Page controls
PSPTPNLRTEDITOR — new PeopleTools 8.50 table that stores attributes relating to the rich-text editor for long character fields.

Components

(Note: Components still have the name panel group in the PeopleTools table names)
PSPNLGRPDEFN — Component header table
PSPNLGROUP — Pages in the components

Component Interface

PSBCDEFN — header record; one row for each component interface
PSBCITEM — one row for each property

Menus

PSMENUDEFN — Menu header table
PSMENUITEM — Items (components) on the menu

Security

PSCLASSDEFN — Permission List header table
PSAUTHITEM — Menu items granted security by permission lists
PSROLEDEFN — Role header table
PSROLECLASS — Permission Lists in roles
PSOPRDEFN — User ID header table
PSROLEUSER — Roles granted to users
PSAUTHBUSCOMP — Access to Component Interfaces

Process Scheduler

PS_PRCSDEFN — Process Definition Header
PS_PRCSDEFNGRP — Process Group
PS_PRCSDEFNPNL — Component
PS_PRCSJOBDEFN — Job Header
PSPRCSRQST — Process Request Instances
PS_PRCSJOBITEM — Job Processes

Portal

PSPRSMDEFN — Content References and Folders
PSPRUHTABPGLT — Portal User HP Tab Pagelet
PSPRUHDEFN — Homepage definition (from here)
PSPRUHTAB — Homepage Tab (from here)
PSWEBPROFNVP — Web Profile Settings

Change Control

PSCHGCTLHIST — shows history of locked definitions with project name, incident, and description
PSCHGCTLLOCK — shows definitions that are currently locked

Application Engine

PSAEAPPLDEFN — header record; 1 row per app engine
PSAEAPPLSTATE — state records assigned to app engines
PSAEAPPLTEMPTBL — temp tables assigned to app engines
PSAESECTDEFN — sections
PSAESTEPDEFN — steps
PSAESTEPMSGDEFN
PSAESTMTDEFN — actions (action types)

HTML Definitions

PSCONTDEFN — header record; last update time, etc.
PSCONTENT — stores actual text in the HTML definition

SQL Definitions

PSSQLDEFN — header record; last update time, etc.
PSSQLTEXTDEFN — stores actual text in the SQL definition

File Layout Definitions

PSFLDDEFN — header record; last update time, etc.
PSFLDSEGDEFN — stores the segments for each layout
PSFLDFIELDDEFN — stores the fields for each layout

Workflow

APPR_RULE_DETL – Approval Rule Defn Details
APPR_RULE_FIELD – Approval Rule Defn Route Cntl
APPR_RULE_AMT – Approval Rule Amounts
RTE_CNTL_LN – Route Control Profile Line
RTE_CNTL_RUSER – RoleUser Route Cntl Profiles
RTE_CNTL_TYPE – Route Control Type
RTE_CNTL_HDR – Routing Control Type
PSWORKLIST — list of work items for each user
PS_WF_INSTSTATUS — description of the status

Timings

BAT_TIMINGS_LOG
BAT_TIMINGS_DTL
BAT_TIMINGS_FN

 

Reference: http://peoplesofttechops.blogspot.com/2016/06/useful-stuff-for-peoplesoft-upgrade.html

addattachment peoplecode

addattachment peoplecode

addattachment peoplecode example

AddAttachment :  You can use the this function to upload one file from an end user machine to a specified storage location. To upload more than one file with a single function call, use the MAddAttachment function.

Syntax of AddAttachment:

AddAttachment(URLDestination, DirAndFilePrefix, FileType, UserFileName[, MaxSize [, PreserveCase[, UploadPageTitle[, AllowLargeChunks]]]])

&retcode = AddAttachment(“record://PSFILE_ATTDET”, ATTACHSYSFILENAME, “”, ATTACHUSERFILE, 0);

If you can upload more find then using peoplecode function “MAddAttachment”

 

Syntax of MAddAttachment:

MAddAttachment(URLDestination, DirAndFilePrefix, Prompts, &UserFileArray, &ActualSizeArray, &DetailedReturnCodeArrayName [, MaxSize [, PreserveCase[, UploadPageTitle[, AllowLargeChunks[, StopOnError]]]]])

Example
&retcode = MAddAttachment(URL.MYFTP, ATTACHSYSFILENAME, 4, &MyFileArray, &MySzArray, &MyRtrnCodeArray, 0, False, “Upload Attachments”, False, True);
The following example demonstrates initialization of the arrays used to store the values returned by MAddAttachment:

&prompts = 2;
Local array of string &AttachUsrFiles;
&AttachUsrFiles = CreateArrayRept(“”, 0);

Local array of number &AttachSzs;
&AttachSzs = CreateArrayRept(0, 0);

Local array of number &AttachRtrnCds;
&AttachRtrnCds = CreateArrayRept(0, 0);

If Exact(Left(&URL_ID, 4), “URL.”) Then
&sum_rt_cd = MAddAttachment(@(&URL_ID), ATTACHSYSFILENAME, &prompts, &AttachUsrFiles, &AttachSzs, &AttachRtrnCds);
Else
&sum_rt_cd = MAddAttachment(&URL_ID, ATTACHSYSFILENAME, &prompts, &AttachUsrFiles, &AttachSzs, &AttachRtrnCds);
End-If;

 

 

Reference:https://docs.oracle.com/cd/E25688_01/pt852pbr0/eng/psbooks/tpcl/chapter.htm?File=tpcl/htm/tpcl02.htm%2348df64020f1b7a4_5c62bc_1229ed4fbbe__7483

Reference:https://docs.oracle.com/cd/E80738_01/pt854pbh2/eng/pt/tpcl/langref_PeopleCodeBuilt-inFunctionsAndLanguageConstructs_M.html#topofpage