Tips & Techniques


Regular expressions (or regex as it is affectionately called) is a powerful tool for searching (and also, replacing) complex text patterns. A quick tutorial can be found at www.regular-expressions.info.[1] To quote from that site:

If you are a programmer, you can save yourself lots of time and effort. You can often accomplish with a single regular expression in one or a few lines of code what would otherwise take dozens or hundreds.

In addition to that argument, writing your own implementation with dozens of lines of code also makes it prone to defects, and makes it more difficult to maintain. And if the required pattern is changed slightly, the impact on your code could be very huge, or even require a rewrite of your custom implementation. With regex, what is often required is to change a few characters in the pattern.[2]

PeopleCode do not have an implementation of regular expressions, but fortunately, it is easy to utilize Java objects from PeopleCode. Note that regex capabilities was only added to Java since version 1.4.

read more…

PeopleSoft pages use CSS-based stylesheets for defining the look (style) of each page element. CSS is a web standard for defining the presentation of a webpage. If you’re new to this concept and want to know more, there’s tons of tutorials and articles. PeopleSoft StyleSheets are created in Application Designer using a GUI editor which looks somewhat similar to Nvu’s CSS Editor:

read more…

One way to customize a PeopleSoft page is to execute javascript to manipulate the DOM. Some possible scenarios that may make this necessary:

  • add dynamic elements to your page (set some elements as draggable maybe? or perhaps adding mouseover behavior to PeopleSoft page elements)
  • removal/manipulation of elements not accessible via Application Designer (automatically added elements outside of a page definition: navigation elements, Close/Ok/Apply buttons in modal pages, etc.)

read more…

Last time I discussed comparing a variable to a list of values using a PeopleCode array. Another nifty use of a PeopleCode array is for joining a list of values with a delimiter.

read more…

I sometimes come across a chunk of PeopleCode that requires a variable be compared to a list of values — like the IN operator in SQL:


If &code = "ABCD" Or &code = "HIJK" Or &code = "OPQR" Then
   ...

If the condition needs to be checked multiple times within the code and the list changes, there will be some effort required to update the code.

A better coding approach is to use an array and its Find method:

read more…

« Previous Page