This code should be helpful if you are trying to hide a grid column using PeopleCode
To
hide a column in a grid (using the Grid and GridColumn objects). You no
longer must loop through every row in the grid and hide that field. Now
you can use the GridColumn property Visible. The Visible property will
also hide grid columns that are displayed as tabs in the PeopleSoft
Internet Architecture.
Local Grid &GRID;
Local GridColumn &COLUMN;
If COMPLETE_FLAG = "Y" Then
&GRID = GetGrid(PAGE.RESOURCE, "GRID1");
&COLUMN = &GRID.GetColumn("COL5");
&COLUMN.Visible = False;
End-If;
| Title | Under | Posted on |
|---|---|---|
| MD5 - SHA checksum of a file. | PeopleSoft Technical | 02/07/2012 - 5:29am |
| nVision Tabular Report through PIA with prompts | PeopleSoft Technical | 02/02/2012 - 10:07pm |
| Can we create an AE to mass update Position - Jobcode data? | PeopleSoft Technical | 01/18/2012 - 3:11am |
| Pay Components on job data can be defaulted and setup based on the rules? | PeopleSoft Functional | 01/05/2012 - 4:58am |
Comments
Anyone know how to center a field on a grid? I've been looking all over the planet for a simple listing of the GridColumn's properties, but can't seem to find them anywhere.
Any help would be EXTREMELY appreciated....
Just add few dummy fields in the grid with the intended field.
Position your field at center. Hide the dummy fields in the page.
This way you can make your field to position at center.
Regards,
Hari.A
Hi Lepa,
Is their anything in Grid Properties by which we can arrange the rows for a perticular column in ascending or descending order????
Yes. There is a property called Allow column sorting. you need to check this grid property to sort the grid columns at run time.
Regards,
Hari.A
Can we expand or collapse a grid using peoplecode?
Can we expand or collapse a grid using peoplecode?
Put the Grid in a Group box and Expand/Collapse the group box through PeopleCode may suits for your requirement.
With regard to the following two lines of code from the above solution:
&GRID = GetGrid(PAGE.RESOURCE, "GRID1");
&COLUMN = &GRID.GetColumn("COL5");
...how does one obtain the grid and column names? I don't see anything useful on the Page Field properties. I've attempted to use the record name, but then the PeopleCode editor barks at me for not also specifying a field. (When I provide a field, the error vanishes, but then the page doesn't do anything either.) If I use string literals, as in the above code, I receive the following error: "A PeopleCode program contains a call to the GetGrid built-in function with invalid parameters. The specified page/grid/occurrence cannot be found."
Thanks in advice.
The PeopleCode documentation says that the grid name is the "Page Field" name from the General tab. Interestingly, that gave me an error in the first place (prompting me to come here looking for help)...but I'm gonna try again (by first renaming the page field so that it's not identical to the record name; presumably that's what was causing the error...)
Did you ever get the hide column to work? I'm having the same problem with the error message, but renaming the page field didn't get rid of the error.
Here is a working example where the page name is "HRS_INT_SCHED", the grid name is also "HRS_INT_SCHED", and the PAGE FIELD name is "AVAILABILITY":
GetGrid(Page.HRS_INT_SCHED, "HRS_INT_SCHED").GetColumn("AVAILABILITY").Visible = False;
Another example, where the page name is "HRS_INT_SCHED" but the grid name is also "HRS_INT_VENUE", and the PAGE FIELD name is "AVAILABILITY_2" (I added 2 to the page field name to make it unique from the other):
GetGrid(Page.HRS_INT_SCHED, "HRS_INT_VENUE").GetColumn("AVAILABILITY_2").Visible = False;
The key is in knowing where to go for the PAGE FIELD name: It's under the "Order" tab (not the "Layout" tab) in app designer.
Hope this helps.
You can use the DataAreaCollapse property of whatever rowset the grid is in (the actual DB table of the grid).
Post new comment