How to Hide/ Disable Delete Button in Scroll Area or Grid Area by PeopleCode of Peoplesoft

How to Hide/ Disable Delete Button in Scroll Area or Grid Area by PeopleCode of Peoplesoft

How to Hide/ Disable Delete Button in Scroll Area or Grid Area by PeopleCode of Peoplesoft. 

If you grid area or scroll area in level 1 on page peoplecode and do not show delete button on grid some row of record by condition. You can function in peoplecode is DeleteEnabled for hide or show it by condition.

Grid area level 1 in Page

You can hide delete button all row by peoplecode

Local Rowset &rs0, &rs1, &rs1_1, &level1, &level2;

&rs0 = GetLevel0();
&rs1 = &rs0.GetRow(1).GetRowset(Scroll.TABLE_TEST);
&rs1.DeleteEnabled = False;

Result of grid view that hide delete button all row

 

 

 

 

 

You can hide delete button some row by peoplecode

Local Rowset &rs0, &rs1, &rs1_1, &level1, &level2;

&rs0 = GetLevel0();
&rs1 = &rs0.GetRow(1).GetRowset(Scroll.TABLE_TEST);

For &i = 1 To &rs1.ActiveRowCount
If &i = 3 Then
&rs1(&i).DeleteEnabled = False;
End-If;

End-For;

Result of grid view that hide some delete button

if you don’t ues peoplecode for hide all delete button. You hide all delete button by goto

Grid Properties > click tab Use > Click check box at No Row Delete

Table of Label Field Name in Peoplesoft

Table of Label Field Name in Peoplesoft

Select label name of filed data in sql of peoplesoft. Table of Label Field Name in Peoplesoft can use this sql.

select * from PSDBFLDLABL

/*–Label of field in Language –*/

select * from PSDBFLDLABLLANG

Translate Values Table Name in Peoplesoft

Translate Values Table Name in Peoplesoft

Select translate values data in sql for Translate Values Table Name in Peoplesoft

select * from PSXLATITEM

/*–Translate Value Lanquage –*/

select * from PSXLATITEMLANG

 

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’;

How to Create Menu in Peoplesoft

How to Create Menu in Peoplesoft

You can create menu of peoplesoft for contain component 

Step 1. Create Menu in Application Desingner

File > New > Menu > Define Name and save

Step 2. Drag and drop your component into menu

If you create navigation Link of Peoplesoft

Step 1. Go to Navigate Menu : Main Menu > PeopleTools > Portal > Structure and Content

Step 2. Create Folder or link (Content Reference)

If you create folder then click Add folder Link

Define *Name: __________

Define * Label:_________

If you create folder then click

       Add Content Reference 

Define *Name: __________

Define * Label:_________

Define : *Node Name:_______

Define: *Menu Name:_______

Define : *Market:_______

Define: *Component:_______

 

or Click

Add Content Reference Link

How to use Peoplesoft Gethtmltext in Peoplecode

How to use Peoplesoft Gethtmltext in Peoplecode

You use GetHTMLText function about get html area and pass parameters to html dynamic html area by peoplecode

Requirement : Show the number of employees by age range

Step 1: Create HTML Template

Step 2 : Create HTML in Application Designer

Navigate : File > New > HTML

and copy & past code HTML and save name HTML = AGE_HTML

<table style=”width: 474px;” border=”0″ cellspacing=”0″ cellpadding=”0″>
<tbody>
<tr>
<td style=”width: 159px;”>
<table style=”line-height: 20.8px; width: 190px;” border=”1″ cellspacing=”1″ cellpadding=”1″>
<tbody>
<tr>
<td><span style=”font-size: 12px;”><strong>%bind(:1)</strong></span></td>
</tr>
<tr>
<td style=”background-color: #33ccff;”><span style=”font-size: 12px;”><strong>%bind(:2)</strong></span></td>
</tr>
<tr>
<td style=”background-color: #33ccff;”><span style=”font-size: 12px;”><strong>%bind(:3)</strong></span></td>
</tr>
<tr>
<td style=”background-color: #ff99cc;”><span style=”font-size: 12px;”><strong>%bind(:4)</strong></span></td>
</tr>
</tbody>
</table>
</td>
<td style=”width: 74px;”>
<table style=”line-height: 20.8px; width: 280px;” border=”1″ cellspacing=”1″ cellpadding=”1″>
<tbody>
<tr>
<td style=”background-color: #33ccff; width: 20px; text-align: left;” colspan=”2″><span style=”font-size: 12px;”><strong>%bind(:5)</strong></span></td>
</tr>
<tr>
<td style=”background-color: #33ccff; width: 20px; text-align: left;” colspan=”2″><span style=”font-size: 12px;”><strong>%bind(:6)</strong></span></td>
</tr>
<tr>
<td style=”background-color: #33ccff; width: 20px; text-align: left;” colspan=”2″><span style=”font-size: 12px;”><strong>%bind(:7)</strong></span></td>
</tr>
<tr>
<td style=”background-color: #ff99cc; width: 20px; text-align: left;” colspan=”2″><span style=”font-size: 12px;”><strong>%bind(:8)</strong></span></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>

Step 3 : Call  HTML by use GetHTMLText for call AGE_HTML by Peoplecode

Define Parameters for pass value to html code

&para1 = “Age Range”;
&para2 = “< 35”;
&para3 = “35-45”;
&para4 = “> 45”;
&para5 = “Number of Employee”;
&para6 = “25”;
&para7 = “36”;
&para8 = “8”;

TEST1_TBL.HTMLAREA = GetHTMLText(HTML.AGE_HTML, &para1, &para2, &para3, &para4, &para5, &para6, &para7, &para8);

You can past this code in anywhere by your requirement such as page activate  or component peoplecode

Show result HTML after pass parameter

 

 

How to Use scrollselect in Peoplecode

How to Use scrollselect in Peoplecode

You can use scrollselect and scrollflush peoplecode function fro populate data in grid and scroll area for each requirements

For Example 1 :

Local Rowset &rs1_1, &rs1_2;

&rs1_1 = GetRowset(Scroll.TEST1_TBL);
&rs1_1.Flush();
&rs1_1.Select(Record.TEST1_TBL, “where EMPLID = :1 and EFFDT = :2 order by To_Number(EMPLID ) “, &EMPLID , &EFFDT);

&rs1_2 = GetRowset(Scroll.TEST2_TBL);
&rs1_2.Flush();
&rs1_2.Select(Record.TEST2_TBL, “where EMPLID = :1 “, &Emplid);

/*– You can Sort Effdt in Scroll Area –*/
SortScroll(1, Record.TEST1_TBL, TEST1_TBL.EFFDT, “A”);

/*– Hide Row of  TEST1_TBL–*/

Local Rowset &VET_SCROLL, &OWNER_SCROLL, &PET_SCROLL, &VISIT_SCROLL;

/*Get level 0 Rowset*/
&VET_SCROLL = GetLevel0();

/*Now get level 1*/
&OWNER_SCROLL = &VET_SCROLL.GetRow(1).GetRowset(Scroll.TEST2_TBL);

/* The way to read this is at level 0 row 1 get the Rowset for the SCROLL OWNER and call it &OWNER_SCROLL. Now lets get level 2 at row  number = 5 and hide this row of level2 */

&PET_SCROLL = &OWNER_SCROLL.GetRow(5).GetRowset(Scroll.TEST2_2_TBL);
&PET_SCROLL.HideAllRows();

For Example 2 :

Scrollflush(Scroll.TEST1_TBL)
/* Populate Data of Grid Level 1*/
Scrollselect(1,Record.TEST1_TBL,Record.TEST1_TBL,”where EMPLID = :1 and EFFDT = :2 order by To_Number(EMPLID ) “, &EMPLID , &EFFDT);

Scrollflush(Scroll.TEST2_TBL)
/* Populate Data of Grid Level 1*/
Scrollselect(1,Record.TEST2_TBL,Record.TEST2_TBL,”where EMPLID = :1 “, &Emplid);

How to Use Encrypt – Decrypt Password in Peoplesoft

How to Use Encrypt Password in Peoplesoft

You can use peoplecode function of peoplesoft  for encrypt password for security

For example for use encrypt peoplecode function of Peoplesoft 

Define Key for encrypt contain key 1 and key 2

/* 1 defind key1 = “testkey1” = key1 help Encrypt */

&Key1= “testkey1″;

/* 2 encrypt key1 with key2 for input key 2=Jimmy */

&Key2 =”Jimmy”;
&Password= Encrypt(“testkey1”, RTrim(LTrim(“Jimmy “)));

WinMessage(&Password, 0);
&Password is Data encrypt

or use this statment

&Password= Encrypt(&Key1, RTrim(LTrim(&Key2)));

For example for use Decrypt peoplecode function of Peoplesoft 

&decrypt_password = Decrypt(&key1, RTrim(LTrim(&Password)));
WinMessage(&decrypt_password , 0);