SortScroll function
Syntax
SortScroll(level, scrollpath, sort_fields)
Where scrollpath is:
[Record.level1_recname, [Record.level2_recname,] Record.target_recname
and where sort_fields is a list of field specifiers in the form:
[recordname.]field_1, order_1 [, [recordname.]field_2, order_2]. . .
Description
The SortScroll function programmatically sorts the rows in a scroll area on the active page. The rows can be sorted on one or more fields.
Note:
This function remains for backward compatibility only. Use the Sort rowset method instead.
The type of sort done by this function, that is, whether it is a linguistic or binary sort, is determined by the Sort Order Option on the PeopleTools Options page.
Parameters
| Parameter | Description |
|---|---|
|
level |
Integer specifying the level of the scroll to sort. It can be 1, 2, or 3. |
|
scrollpath |
A construction that specifies a scroll area in the component buffer. |
|
sort_fields |
A list of field and order specifiers which act as sort keys. The rows in the scroll area are sorted by the first field in either ascending or descending order, then by the second field in either ascending or descending order, and so on. |
|
[recordname.]field_n |
Specifies a sort key field in target_recname. The recordname prefix is required if the call to SortScroll is in a record other than target_recname. |
|
order_n |
A single-character string. "A" specifies ascending order; "D" specifies descending order. |
Returns
Optionally returns a Boolean value indicating whether the function executed successfully.
Example
The first example repopulates a scroll in a page programmatically by first flushing its contents, selecting new contents using ScrollSelect, then sorting the rows in ascending order by EXPORT_OBJECT_NAME:
Function populate_scrolls;
ScrollFlush(Record.EXPORT_OBJECT);
ScrollSelect(1, Record.EXPORT_OBJECT, Record.EXPORT_OBJECT,
"where export_type = :EXPORT_TYPE_VW.EXPORT_TYPE");
SortScroll(1, Record.EXPORT_OBJECT, EXPORT_OBJECT.EXPORT_OBJECT_NAME, "A");
End-function;
The second example sorts the rows on scroll level one by primary and secondary key fields:
SortScroll(1,Record.EN_BOM_COMPS,EN_BOM_COMPS.SETID,"A",
EN_BOM_CMOPS.INV_ITEM_ID,"A");
Related Topics
- PeopleCode API Reference: Sort method: Rowset class
- PeopleCode Developer’s Guide: Understanding Data Buffer Access
- HideScroll function
- RowScrollSelect function
- RowScrollSelectNew function
- ScrollSelect function
- ScrollSelectNew function
- UnhideScroll function
- System and Server Administration: PeopleTools Options