PeopleCode: Comparing a variable to a list of values

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:

Continue reading

PeopleCode catching up

The first time I started developing PeopleSoft applications was on version 7.x. Back then, my previous client-side RAD coding experience is with VB6. It was amazing back then to be able to develop an application much more rapidly than VB6. When I learned PeopleCode, it is a bit appalling to see how primitive the language is, even though it borrows quite a lot of syntax from VB. This doesn’t matter though, PeopleCode was just an icing on an already delicious cake. The PeopleSoft application framework already delivers a lot of advantages.

When 8.1x came out, I was delighted to see PeopleCode adapt dot-notation object-style syntax for most of its data access — eliminating the need to use those convoluted functions of 7.x that makes PeopleCode coding a pain to use. The mapping of fields, records, rows and rowset to an object heirarchy makes a lot of sense and it made coding and reading PeopleCode a lot easier. Again, there was a shortcoming — you could only use built-in classes.

8.4x introduced Application Classes. This alone made me very excited about coding 8.4 PeopleCode. I know 8.4 has been around for more than a year now. But it has only been recently that our client upgraded to this version. Now I have the opportunity to create real world applications that take advantage of custom classes.

Continue reading