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

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/

psxlatitem in peoplesoft

psxlatitem in peoplesoft

psxlatitem in peoplesoft is a table for store value of translate value of the field.  psxlatitem has related language record is PSXLATITEMLANG and parent record is PSXLATDEFN.

You can select a value of translate value by using below code of PeopleCode.

SELECT XLATLONGNAME FROM PSXLATITEM WHERE FIELDNAME =’TYPE’ AND FIELDVALUE= ‘1’;

SELECT XLATLONGNAME FROM PSXLATITEMLANG WHERE FIELDNAME =’TYPE’ AND FIELDVALUE= ‘1’;

Using the Translate Table

This section provides an overview of the Translate table and discusses how to:

  • Add values to the Translate table.

  • Change translate values.

  • Delete translate values.

  • Save the Translate table.

Understanding the Translate Table

  • Field type is Character.
  • Field length is 1 to 4 characters.
  • Field values consist of a relatively small, static set of values that are not maintained by the user.
  • No other fields relate to this field.

 

Reference: https://docs.oracle.com/cd/E57990_01/pt853pbh2/eng/pt/tapd/task_UsingtheTranslateTable-077674.html#topofpage

How to Hide/Unhide one option in Radio button PeopleSoft

How to Hide/Unhide one option in Radio button PeopleSoft

How to Hide/Unhide one option in Radio button PeopleSoft by using javascript.

For example. If you have 2 radio button on the page in Peoplesoft contain value Y and N but you want to hide a radio button has value Y.

1.  Define Page Field Name of Radio Button Properties =  RDO_Y

Result Page on Browser

2. Define JavaScript in HTML Area on page in application designer.

<script language=’javascript’>
document.getElementById(‘win0divRDO_Y$0′).style.display=’none’;
</script>

Result page in the browser after using javascript to hide a radio button when value Y is checked

You can find ID: win0divRDO_Y$0 by using right-click and inspect the radio button after the PeopleCode runs.

Another way: you can use a group box of each field radio button and using PeopleCode for hide or unhide radio button for your requirement.

How to use Rich Text Format in PeopleSoft

How to use Rich Text Format in PeopleSoft

How to use Rich Text Format in PeopleSoft in application designer.

You can input detail of requirement in record field long PeopleSoft.

1. Enable Rich Text of long field in application designer.

2. Save Detail

3. Use Detail of 2 by select long filed in the database and define value.

If &Datalong is data that select from your database.

Example: Record.Long_filed = &Datalong;