Hello. I'm new to Peoplesoft and new to this community. I am trying to hide a row within a grid. I found this code on this site:Local Rowset &Level1;
&Level1 = GetLevel0()(1).GetRowset(Scroll.PERSON_ADDRESS);
For &i = 1 To &Level1.ActiveRowCount
&AddrType = FetchValue(Scroll.PERSON_ADDRESS, &i, PERSON_ADDRESS.ADDRESS_TYPE);
If &AddrType <> "HOME" Then
&Level1(&i).Visible = False;
End-If;
End-For;
I'm confused on where to place this code. Could someone help please?
Thanks
| Title | Under | Posted on |
|---|---|---|
| Inserting records | PeopleSoft Technical | 07/28/2010 - 11:03am |
| WEBLIB_PT_NAV.ISCRIPT1.FieldFormula.IScript_PT_NAV_PAGELET error... | PeopleSoft Technical | 07/27/2010 - 2:02pm |
| Basic language | PeopleSoft Technical | 07/27/2010 - 7:12am |
| Rowlevel security from app designer | PeopleSoft Technical | 07/27/2010 - 5:15am |
It kind of depends on how this will occur... Will the hiding occur on page load, after the page has been saved, after the user has clicked a button etc.
If its after page load, you can try putting it on the level 0 record rowinit, page activate peoplecode or component postbuild peoplecode. Because you are looping through the level 1 rowset you would normally have your code execute at a higher level in the buffer, i.e. level 0. Note that the component postbuild and page activate code do not execute at a specific buffer level like record peoplecode does.
Also that FetchValue() is the old style of writing PeopleCode. Instead you could do this:
For &i = 1 To &Level1.ActiveRowCount;
&AddrType = &Level1(&i).PERSON_ADDRESS.ADDRESS_TYPE.Value;
If &AddrType <> "HOME" Then
&Level1(&i).Visible = False;
End-If;
End-For;
Note that this "&Level1(&i).PERSON_ADDRESS.ADDRESS_TYPE.Value" is a shortcut for &Level1.GetRow(&i).GetRecord(Record.PERSON_ADDRESS).GetField(Field.ADDRESS_TYPE).Value.
Good idea,thank you for your share.
Post new comment