Blogs

Hide a Subpage Using PeopleCode

There was a question asked on the forum on how to hid a subpage. There is no Peoplecode function to hide a subpage directly, BUT one way around that is putting the subpage in a group box and hid the group box instead. Hiding the group box will end up hiding your sub page.

Make sure to follow the following post, it will walk you through how to hide a group box on a page.

Create a Database Link

In many cases you might need to compare data between tables across different databases. For example your test instance and production instance.

You can easily create a database link between the 2 instances and be able to access the production data from the test database.

CREATE DATABASE LINK <Link Name>
 CONNECT TO <Schema Name>
 IDENTIFIED BY <PWD>
 USING '(DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = <Host Name>)(PORT = <port#>))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = <Database Name>)
    )
  )'
;

Get Table Sizes in your Schema

If you want to see how much space your tables are taking in the database, log in to the shcema and execute this SQL.

SELECT   segment_name table_name, MAX (tablespace_name) tablespace_name,
         SUM (BYTES) / (1024 * 1024) table_size_mb
    FROM user_extents
   WHERE segment_name IN (SELECT tname
                            FROM tab
                           WHERE tabtype = 'TABLE')
GROUP BY segment_name
ORDER BY tablespace_name

The Above query tells you the table name, the table space it is residing in and the size in MB.

Thanks,

Zooz

Enable Row Movement Between Table Partitions

If you have a table partitoned on a certain column and on one of your loads you try to update that column on already existing records. You might run into this oracle error

Oracle error 14402 : ORA-14402: updating partition KEY COLUMN would cause a partition CHANGE

The above error was caused because when you updated the record, it now belongs to a different partition but since row movement between partitions is not enabled on the table, you got that error.

Delete PeopleSoft Query From the Database

There could be different reasons why a PeopleSoft developer would like to delete a query from the database. Upgrade clean up would probably be the most common one. Here is a function you can use to get you started.

Function DeleteQuery(&sQueryName As string)
   SQLExec("DELETE FROM PSQRYDEFN WHERE QRYNAME=:1", &sQueryName);
   SQLExec("DELETE FROM PSQRYSELECT WHERE QRYNAME=:1", &sQueryName);
   SQLExec("DELETE FROM PSQRYRECORD WHERE QRYNAME=:1", &sQueryName);
   SQLExec("DELETE FROM PSQRYFIELD WHERE QRYNAME=:1", &sQueryName);

Check Box Select/Deselect All on Grid

The below function is to be used on a grid with multiple check boxes. Place the code behind a FieldChange event and users will have the option to Select or Deselect grid rows all at once.

Function selectAllRows(&rs As Rowset)
   Local number &i;
   Local Row &row;
   
   For &i = 1 To &rs.ActiveRowCount
      &row = &rs.GetRow(&i);
      /* Make sure we only select visible rows. */
      If &row.Visible = True Then
         &row.Selected = True;
      End-If;
   End-For;
end-function;

/*main line*/
Local Rowset &rs;

Common Terminology Used in Web Services

Before start using PeopleSoft Integration Broker for sending and receiving services, you need to be familiar with the terminology used for Web services. In this post, I will try to list and describe common terms used for Web services.

Extensible Markup Language (XML): XML is a text-based format that provides a mechanism to describe document structures using markup tags. It allows developers to create their own customized tags, enabling the definition, transmission, validation, and interpretation of data between applications and between organizations.

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. Change control can be activated through Application Designer using Tools > Change Control > Administrator.

After few good size projects, you can easily have hundreds if not thousands of locked objects. Attempting to unlock the objects one by one is very time consuming, so here is a way to speed up the process.

Locked objects are stored on PSCHGCTLLOCK table. Here is how PeopleSoft describes the table:

Traversing the Dept Security tree

We can use the connect by prior function provided by Oracle to traverse the Dept security Tree . Suppose an Organization has 7 levels in Dept tree i.e. 1 to 7 .
We want to traverse the dept tree from level 3 to level 6.
Also we know the deptid at the level 3 say 'LVL3-DPT' .

We can use the following SQL to traverse the whole tree (3-6) starting from 'LVL3-DPT'. Only child of 'LVL3-DPT' will be seen in sql output. The starting deptid has to be used with "START WITH " clause.

SELECT TR.TREE_NODE , TR.TREE_LEVEL_NUM        

FROM PSTREENODE TR

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).

Just replace the record and field for respective level.

&rs_level0 = GetLevel0();

&level0fieldvalue = &rs_level0.(1).Level0_Record.Level0_field.Value ;

&row_level0 = &rs_level0.GetRow(1);
&rs_level1 = &row_level0.GetRowset(Scroll.Level1_Record);
For &J = 1 To &rs_level1.RowCount

   &level1fieldvalue = &rs_level1.GetRow(&J).Level1_Record.Level1_field.Value
   
   &row_level1 = &rs_level1.GetRow(&J);

Unanswered Forum Posts