Peoplecode Events pdf

peoplecode events pdf

peoplecode events pdf of peoplesoft component processor flow.

PeopleSoft Componet Processor Flow

Reference: http://www.aaronwhincop.com/wp-content/uploads/2013/02/PeopleSoft-Component-Processor-Flow.pdf

split function in peoplecode

split function in peoplecode

You can using split function in peoplecode of peoplesoft.  This function to convert a string into an array of strings by looking for the string separator in the given string but this function does not split an array.

Split(string, separator)

If separator is omitted, a blank is used.
If separator is a null string (“”), the string is split into single characters.
If separator is the last character in the string, you will not get an empty string.

For example 1, in the following code, &array only has a value of 2:

&test = “value1:value2:”;
&array = Split(&test, “:”);

For example 2, you can get file and read file.

 

If &In_File.IsOpen Then
While &In_File.ReadLine(&file);
&line = Split(&file, “,”);
MessageBox(0, “Lenght of separate , in file”, 0, 0, ” i len= ” | &line.Len);
End-while;
End-if;

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

How to Remove Carriage Returns (CR) in peoplecode

How to Remove Carriage Returns (CR) in peoplecode

How to Remove Carriage Returns (CR) in peoplecode of peoplesoft. Using peoplecode function is clean() for remove all non-printable characters.

Syntax of clean:  Clean(string)

You can use the clean function to remove all non-printable characters, such as control codes, end of line marks, and unpaired Unicode combining marks, from a text string and returns the result as a String value. It is intended for use on text imported from other applications that contains characters that may not be printable. Frequently, low-level characters appear at the beginning and end of each line of imported data, and they cannot be printed.

Returns

Returns a String value purged of non-printable characters.

Example 1

Because Char(7) (U+0007) is a non-printable character, the following Clean function returns a null string:

&CLEANSTR = Clean(Char(7));

 

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

substitute and replace peoplecode

substitute and replace peoplecode

Different substitute and replace peoplecode function of peoplesoft.

Use the Substitute function to replace every occurrence of a substring found in a string with a new substring. To replace text that occurs in a specific location in a text string using the Replace function.

The syntax of Substitute:  

Substitute(source_text, old_text, new_text)

source_text is a string in which you want to replace substrings.
old_text is a string equal to the substring of source_text you want to replace.

For example 1

Substitute(“2003* 0723* * * * ~”, “* ~”, “~”);

The result:  2003~0723~~~~~

 

Replace function to replace a specified number of characters in a string.

Syntax: Replace(old_text, start, num_chars, new_text)

old_text: A String value, part of which is to be replaced.
start: A Number designating the position in old_text from which to start replacing characters.
num_chars: A Number, specifying how many characters to replace in old_text.
new_text: A String value that replaces num_chars characters.

For example 2

Replace(“2000″,3,2,”18”);

The result of example 2 is  2018

For example 3

Replace(“MeeToo”,4,3,”kkk”);

The result of example 2 is  Meekkk

 

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

isnew function in peoplecode

isnew function in peoplecode

How to use isnew function in peoplecode.

IsNew: This property is True if the row is a new (inserted) row.
Example
&tmp = &ROW.IsNew;

 

 

Reference:https://docs.oracle.com/cd/E41633_01/pt853pbh1/eng/pt/tpcr/langref_RowClassProperties-c07c69.html#IsNew-c07c62

Record Change PeopleCode

Record Change PeopleCode

How to check record change PeopleCode in peoplesoft. I have the example about checking record in saveprechange event, field change event or save edit of PeopleCode. Define page has scroll area in level 1 and the user can edit the value of each field. When the user changes data and saves data then system update date time and operator id.

Example 1

Example 2: Check record change from some field in page in scroll area level 1. This code using for loop all record in level one. If record changed then update filed last_emplid and LAST_UPDATE_DTTM1. I replace code at SavePreChange action of record contracts (saveedit, savepostchange,etc).

Exmaple 3: The code would execute on level one, checks rows on level two to determine which have been changed

 

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

How to Get Current Row Number in a Grid or Scroll Area

How to Get Current Row Number in a Grid or Scroll Area

How to Get Current Row Number in a Grid or Scroll Area by peoplecode function of PeopleSoft.  The CurrentRowNumber function returns the current row on level one, or the parent row of the level two row where the PeopleCode program is executing.

Using function peopolecode is currentrownumber(scrolllevel);

This PeopleCode get value current row number in a grid or scroll by level.

if your grid or scroll area is @level 1 then use Currentrownumber(1) method spell.

if your grid or scroll area is @level 2 then use Currentrownumber(2) method spell.

For example 1. I have scrollarea level 1 on page and show row number of record in scroll area level 1 by peoplecode at below picture.

You define field number or character and replace peoplecode in rowinit event of this field.

DERIVED.SEQ.value = CurrentRowNumber(1);

——————————————————————————————————————–

Using Peoplecode for rearrange row equal rownum of grid area

Local Rowset &LEVEL0, &LEVEL1;

If %Page = Page.TS_TRF_JOB_DATA Then

Local Row &LEVEL0_ROW;

&LEVEL0 = GetLevel0();
&LEVEL0_ROW = &LEVEL0(1);
&LEVEL1 = &LEVEL0_ROW.GetRowset(Scroll.TS_TRF_JOBDATA);

For &i = 1 To &LEVEL1.ActiveRowCount
&LEVEL1_ROW = &LEVEL1(&i);
&LEVEL1(&i).TS_TRF_JOBDATA.SEQ.Value = &i;
End-For;
End-If;

References:

  1. https://it.toolbox.com/question/current-row-number-in-a-grid-081313
  2. https://docs.oracle.com/cd/E41509_01/pt852pbh2/eng/psbooks/tpcd/chapter.htm?File=tpcd/htm/tpcd05.htm%23g037ee99c9453fb39_ef90c_10c791ddc07__4b04

How to find PeopleSoft Project Item List SQL

How to find PeopleSoft Project Item List SQL

How to find PeopleSoft Project Item List SQL in table PSPROJECTITEM.

This SQL for select all list your project in application designer (AE) such as sql table, sql view table, work record, sub record, dynamic view, query view, temp table, other record or deleted, index, field, page, menu, component.

SQL help you run a sql query to list all the objects in a project in application designer.

 

Reference: http://peoplesofttutorial.com/sql-to-list-project-items-in-peoplesoft/

GetHTMLText PeopleCode

GetHTMLText PeopleCode

GetHTMLText PeopleCode is function.

For Example Using HTML Definitions and the GetHTMLText Function

1. Create HTML Object in Application Designer and define name is TABLE_HTML

<P> <TABLE> <TR bgColor=#008000> <TD> <P><FONT color=#f5f5dc face=”Arial, Helvetica, sans-serif” size=2> %bind(:1) </FONT></P></TD></TR> <TR bgColor=#0000cd> <TD> <P><FONT color=#00ffff face=”Arial, Helvetica, sans-serif” size=2>%bind(:2)</FONT></P></TD></TR> </TABLE></P>

2.  Call HTML object by use GetHTMLText Function and pass parameter.

Local Field &HTMLField; &HTMLField = GetField();
&string = GetHTMLText(HTML.TABLE_HTML,”message 1″,”message 2″);

&HTMLField.Value = &string;

3. Result of GetHTMLText

Ref: https://docs.oracle.com/cd/E41509_01/pt852pbh2/eng/psbooks/tpcd/chapter.htm?File=tpcd/htm/tpcd08.htm%23g037ee99c9453fb39_ef90c_10c791ddc07__4a9a