BulkModifyPageFieldOrder function

Syntax

BulkModifyPageFieldOrder({ProjectName | PageList}, ColNames, RequireAll, [ColWidths])

Description

Use the BulkModifyPageFieldOrder function to reorder the grid columns as specified by ColNames. If ColWidths is specified, the columns are also resized. This can also be used to modify a single columns width.

Note:

You must have the role PeopleSoft Administrator assigned to your UserId in order to use this function.

If you specify a project name as a parameter, and if that project contains objects such as fields which have an upgrade action of delete, those objects are ignored.

The reordering algorithm “bunches” these fields together at the first instance of any of these fields in a target page grid, and forces the remaining fields into the order specified.

This function only reorders fields inside a grid.

If the fields occur twice or more in a grid, from two or more records, such as work records, the fields are bunched together in record groupings before being sorted into the order specified. For example, the two records ABS_HIST and PERSONAL_HISTORY both contain the fields DURATION_DAYS and DURATION_HOURS. The following is an example of how the records are fields would be bunched together first:

  • ABS_HIST, DURATION_DAYS

  • ABS_HIST, DURATION_HOURS

  • PERSONAL_HISTORY, DURATION_DAYS

  • PERSONAL_HISTORY, DURATION_HOURS

Note:

These changes take affect after components are reloaded.

Parameters

Parameter Description

ProjectName | PageList

Specify either the name of a project that is the source of pages to use or an array of page names.

Note: When passing the project name as a parameter, if the project contains definitions with an upgrade action of delete, the system ignores those definitions.

ColNames

Specify an array of string that indicate which fields and the desired order of those fields.

RequireAll

Specify whether all the fields in ColNames must be present before changes are made or not. This parameter takes a Boolean value: True, all fields must be present.

ColWidths

Specify an array of number that gives the pixel widths of the grid columns. Use a -1 to indicate that the width of a column shouldn't change.

Returns

A constant value. The values are:

Value Description

%MDA_Success

Bulk operation completed successfully.

%MDA_Failure

Bulk operation did not complete successfully.

Example

Local Array of String &ColOrder; 
Local Array of Number &ColWidth; 
Local String &pjm, &ret; 
&pjm = "MYPROJ"; 
&ColWidth = CreateArray(50, 100, -1); 
&ColOrder = CreateArray("DEPTID", "ORGID", "PROJECT"); 
&ret =  BulkModifyPageFieldOrder(&pjm, &ColOrder, True, &ColWidth); 
If (&ret = %MDA_Success) Then 
   MessageBox(0, "Metadata Fn Status", 0, 0, "BulkModifyPageFieldOrder⇒
 succeeded"); 
Else 
      MessageBox(0, "Metadata Fn Status", 0, 0, "BulkModifyPageFieldOrder⇒
 failed"); 
End-If;

Using the Log File

Information about this operation is stored in a log field. The directory where the log file is placed depends on where the function is run from:

  • If the function is run in two-tier, the log file is located at PS_CFG_HOME /BulkOps.txt. This is also the default location if the system cannot find the other paths.

  • If the function is run from an application server, the log file is located here:

    PS_CFG_HOME /APPSERV/Domain_Name/LOGS/BulkOps.txt

  • If the function is run from an Application Engine program, the log file is written to the process' output log directory, that is:

    PS_CFG_HOME /APPSERV/prcs/Domain_Name/log_output/Process_Name_Instance/BulkOps.txt

Considerations Using this Function

This function is intended for use during configuration time only, before active runtime usage is initiated. Using this function during active runtime is not supported. Changes to data definitions are not recognized on currently loaded component. In general, changes aren't recognized until the component is reloaded.

Bulk operations are time consuming, therefore, referencing the log file to see the progress of an operation is recommended. These operations accommodate errors and continue processing, logging the overall progress of the operation.

WARNING:

These operations take place in a separate transaction from the page's save status: the initiation of any of these operations immediately changes the definitions, even if the page is subsequently cancelled.