object oriented peoplecode
DESCRIPTION
PeopleSoft PeopletoolsTRANSCRIPT
![Page 1: Object Oriented PeopleCode](https://reader035.vdocuments.us/reader035/viewer/2022081804/55cf9a0a550346d033a03acc/html5/thumbnails/1.jpg)
USM Regional Oracle/PeopleSoft
Conference
June 8, 2007
Object-Oriented PeopleCode
![Page 2: Object Oriented PeopleCode](https://reader035.vdocuments.us/reader035/viewer/2022081804/55cf9a0a550346d033a03acc/html5/thumbnails/2.jpg)
Object-Oriented PeopleCode
How to use object-oriented PeopleCode to manipulate data in the component buffer.
Understanding the four object classes that are used to "traverse the buffer": Rowsets, Rows, Records, and Fields.
![Page 3: Object Oriented PeopleCode](https://reader035.vdocuments.us/reader035/viewer/2022081804/55cf9a0a550346d033a03acc/html5/thumbnails/3.jpg)
Data Buffer Access Classes
What is a Rowset Object?
What is a Row Object?
What is a Record Object?
What is a Field Object?
![Page 4: Object Oriented PeopleCode](https://reader035.vdocuments.us/reader035/viewer/2022081804/55cf9a0a550346d033a03acc/html5/thumbnails/4.jpg)
Data Buffer Access Classes
![Page 5: Object Oriented PeopleCode](https://reader035.vdocuments.us/reader035/viewer/2022081804/55cf9a0a550346d033a03acc/html5/thumbnails/5.jpg)
Functions, Methods, and Properties
Function( )
GetLevel0( )
<object>.Method( )
&RSLevel2.GetRow(12)
<object>.Property
&FldEmplid.Enabled = False;
![Page 6: Object Oriented PeopleCode](https://reader035.vdocuments.us/reader035/viewer/2022081804/55cf9a0a550346d033a03acc/html5/thumbnails/6.jpg)
Longhand and Shorthand Notation
Understanding both longhand notation and shorthand notation -- A four-step recipe to convert from longhand to shorthand.
Optimizing your code for re-usability in multiple applications - the benefits of object-oriented code.
![Page 7: Object Oriented PeopleCode](https://reader035.vdocuments.us/reader035/viewer/2022081804/55cf9a0a550346d033a03acc/html5/thumbnails/7.jpg)
Advantages of Object-Oriented PeopleCode
A different style of programming is not justified unless it has advantages.
Object-oriented PeopleCode is better organized, easier to maintain, and more reusable than older procedural style PeopleCode.
![Page 8: Object Oriented PeopleCode](https://reader035.vdocuments.us/reader035/viewer/2022081804/55cf9a0a550346d033a03acc/html5/thumbnails/8.jpg)
Data Buffer Access Classes
&RSLevel2 = GetRowset(Scroll.TRN_CRSE_ENR_XX);For &I = 1 To &RSLevel2.ActiveRowCount &RecCourseEnr =
&RSLevel2.GetRow(&I).GetRecord(Record.TRN_CRSE_ENR_XX); If TRN_CRSE_SES_XX.SESSION_STATUS <> "A" Then &RecCourseEnr.GetField(Field.EMPLID).Enabled = False; &RecCourseEnr.GetField(Field.TRAINING_REASON).Enabled = False; &RecCourseEnr.GetField(Field.STDNT_ENRL_STATUS).Enabled = False; &RecCourseEnr.GetField(Field.COMMENTS).Enabled = False; Else &RecCourseEnr.GetField(Field.EMPLID).Enabled = True; &RecCourseEnr.GetField(Field.TRAINING_REASON).Enabled = True; &RecCourseEnr.GetField(Field.STDNT_ENRL_STATUS).Enabled = True; &RecCourseEnr.GetField(Field.COMMENTS).Enabled = True; End-If;End-For;
![Page 9: Object Oriented PeopleCode](https://reader035.vdocuments.us/reader035/viewer/2022081804/55cf9a0a550346d033a03acc/html5/thumbnails/9.jpg)
Data Buffer Access Classes Reusable Code
&TrueOrFalse = (SESSION_STATUS = "A");&RowCurrent = GetRow();
For &I = 1 To &RowCurrent.ChildCount &RSLevel2 = &RowCurrent.GetRowSet(&I); For &J = 1 To &RSLevel2.ActiveRowCount &RowLevel2 = &RSLevel2.GetRow(&J); For &K = 1 To &RowLevel2.RecordCount &RecLevel2 = &RowLevel2.GetRecord(&K); For &L = 1 To &RecLevel2.FieldCount &RecLevel2.GetField(&L).Enabled = &TrueOrFalse; End-For; End-For; End-For;End-For;
![Page 10: Object Oriented PeopleCode](https://reader035.vdocuments.us/reader035/viewer/2022081804/55cf9a0a550346d033a03acc/html5/thumbnails/10.jpg)
Reusable Code
Put reusable code in a function library or an Application Package.
Leverage the code across multiple applications.
![Page 11: Object Oriented PeopleCode](https://reader035.vdocuments.us/reader035/viewer/2022081804/55cf9a0a550346d033a03acc/html5/thumbnails/11.jpg)
Reusable Code – Function Library
Begin-Function EnableDisable (&RowCurrent, &TrueOrFalse)For &I = 1 To &RowCurrent.ChildCount &RSLevel2 = &RowCurrent.GetRowSet(&I); For &J = 1 To &RSLevel2.ActiveRowCount &RowLevel2 = &RSLevel2.GetRow(&J); For &K = 1 To &RowLevel2.RecordCount &RecLevel2 = &RowLevel2.GetRecord(&K); For &L = 1 To &RecLevel2.FieldCount &RecLevel2.GetField(&L).Enabled = &TrueOrFalse; End-For; End-For; End-For;End-For;End-Function;