Professional Documents
Culture Documents
Classes
A class is the formal definition of an object and acts as a template from which an instance of an object is created at runtime. The class defines the properties of the object and the methods used to control the objects behavior.
Classes
PeopleSoft delivers predefined classes (such as Array, File, Field, Rowset, SQL, and so on). You can create your own classes using the Application class. You can extend the functionality of the existing classes using the Application class.
Classes An example
File class - provides methods and properties for reading from and writing to external files
Objects
An object represents a unique instance of a data structure defined by the template provided by its class.
Each object has its own values for the variables belonging to its class and responds to methods defined by that class.
Object Instantiation
A class is the blueprint for something, like a bicycle, a car, or a data structure. An object is the actual thing that's built using that class (or blueprint.) For example, from the blueprint for a bicycle, you can build a specific mountain bike with 23 gears and tight suspension. From the blueprint of a data structure class, you build a specific instance of that class. For example, an instance of the Record class could be PERSONAL_DATA. Instantiation is the term for building that copy, or an instance, of a class.
Define a variable
Local File &fEMPDIRU_OUT;
2.
Note: GetFile is a built-in function used to instantiate a new file object from the File class, associate it with an external file, and open the file so you can use File class methods to read from or write to it.
Properties
A property is an attribute of an object (think adjective). Properties define:
Object characteristics, such as name or value. The state of an object, such as deleted or changed.
Properties An Example
IsOpen is a property of the File class which returns a Boolean value indicating whether the file is open.
If &fEMPDIRU_OUT.IsOpen Then
Methods
A method is the code associated with a given object (think verb). A method is a procedure or routine, associated with one or more classes, that acts on an object.
Methods An Example
WriteLine is a method of the File Class that writes
one string of text, string, to the output file associated with the file object executing this method.
&fEMPDIRU_OUT.WriteLine(&sRecOut);
Some of the other methods include Close, Delete, Open, and ReadLine.
Dot Notation
The means through which you access an objects properties or execute its methods.
This enables you to reference fields within a record object, records within a row object, and rows within a rowset object as properties of the parent objects.
&sMaidenName = &Rec_Names.LAST_NAME.Value;
DERIVED_NAME.UPDATE_NAME_BTN.Enabled = False;
The area in memory that stores data for the currently active component. Consists of rows of buffer fields that hold data for the records associated with page controls, including primary scroll records, related display records, derived/work records, and Translate table records.
In a contextual reference, PeopleCode refers to a row or buffer field determined by the context in which a PeopleCode program is currently executing (think relative).
A scroll path specifies a scroll level in the currently active page (think absolute).
Contextual Reference
Refers to a row or buffer field determined by the context in which a PeopleCode program is currently executing. The current context includes
All buffer fields in the row of data where the PeopleCode is executing All buffer fields in rows that are hierarchically superior to the row where the PeopleCode is executing
Contextual Reference
Level zero row is always in context
Row where PeopleCode is currently executing All rows on lower scroll area out of context
If GetRowSet().ParentRowset.ParentRow.IsDeleted Then
Scroll Paths
A scroll path specifies a scroll level in the currently active page. If the level you want to reference is level one, you must supply only the RECORD.target_recname parameter. If the target scroll level is greater than level one, you must provide scroll name and row level parameters for all hierarchically superior scroll levels, beginning at level one.
Scroll Paths
Target Level
1
Repeat after me
Rowset
Row
Record Field
A rowset object is a data structure used to describe hierarchical data. It is made up of a collection of rows. Think of a rowset as a scroll on a page that contains all that scrolls data. A level 0 rowset contains all the data for the entire component.
row object represents a single row in a component scroll A row contains one or more records. A row may also contain child rowsets.
record object is a single instance of data within a row and is based on a record definition. A record contains one or more fields.
field object is a single instance of data within a record and is based on a field.
Scrolls allow you to insert, delete, and navigate through multiple rows of data. The keys of the occurs level 1 record definition must include the same search keys as level 0, with at least one additional key. PeopleSoft allows only one primary record definition per scroll. Fields from other record definitions may appear on a level for related display or as derived/work fields.
The maximum possible value of an occurs level for a component is 3. PeopleSoft allows multiple primary record definitions at occurs level 2 and 3, but each primary record definition requires its own scroll. Occurs level 2 primary record definitions must have the same key fields as occurs level 1 plus at least one additional key field. Occurs level 3 primary record definitions must have the same key fields as occurs level 2 plus at least one additional key field.
&RS = GetLevel0()(1).GetRowset(SCROLL.Owner);
For &i = 1 to &RS.ActiveRowCount &Row = &RS.GetRow(&i); For &j = 1 to &Row.RecordCount
&Rec = &Row.GetRecord(&j);
For &k to &Rec.FieldCount &Field = &Rec.GetField(&k) End-For;
End-For;
End-For;
WHEN you want it to execute WHERE to place your PeopleCode WHAT to program
- Part 1
WHAT to program
Workshop Tomorrow
For more information on this topic, sign up for one of the workshops to be held tomorrow
9:00 am 12:00 pm
1:00 pm 4:00 pm