PeopleSoft

Knowledge, Information and Tools for PeopleSoft-Professionals     


Home | Forums | Ask the Pros | FAQ  | Blogs | Events | Code | Books | Solutions | Tell a Friend | Advertise

Manipulating Data on a Grid: Scroll PeopleCode

 
Source/Author  mkpowers@mkpowers.net
 

 

This
article is an excerpt from the eBook – A Guide to Programming Object Scroll
PeopleCode. 
Download
Your Copy Today!


When you have a grid that is filled with data; data that
you don’t want. How do you clear it out and then fill it with the data set
that you do want?  Here are the
steps.


Ok so lets say we have a Grid on a page and the main record
on the grid is COMPETENCIES.  Well
first we want to define a Rowset object to manipulate.


Local Rowset &COMPETENCIES;


 Next we want to instantiate the object. You notice I
am not creating a Rowset I am getting the Rowset from the Grid. I am defining
the Grid object as a Rowset.


 &COMPETENCIES = &REVIEW(CurrentRowNumber(1)).GetRowset(Scroll.COMPETENCIES);


Once
that is complete, I want to remove all rows of data from the Grid.


&COMPETENCIES.Flush();


Now
lets fill it up.


&COMPETENCIES.Select(Record.COMPETENCIES,
"WHERE EMPLID = :1 AND EVALUATION_ID = :2 AND COMPETENCY IN " |
&IN | " AND EFFDT = %DATEIN(:3)", &EMPLID, &EVALUATION_ID,
&REVIEW_DT);


What we are doing here is
selecting the data that we want to fill the grid with. By selecting the record
we are in essence saying select all the fields that are on the grid from the
COMPETENCIES table with the where clause.

 
<< Back to Index