BulkDeleteField function
Syntax
BulkDeleteField(ProjectName, Field.FieldName [, ExclProj])
Description
Use the BulkDeleteField function to delete fields from records and pages, as well as the associated PeopleCode programs and modify the SQL either on the record, or, if the record is a subrecord, on the parent records.
Note:
You must have the role PeopleSoft Administrator assigned to your UserId in order to use this function.
If you specify a project that contains objects such as fields which have an upgrade action of delete, those objects are ignored.
The field is removed from the page regardless of where the field exists on the page, whether on a grid or not.
If the field is in the SELECT clause of the SQL, the removal is straightforward. However, if the field is also used in a WHERE clause, or if the field is the only item in the SELECT clause, the record isn't modified and is instead inserted into a project called BLK_FieldName. The record should be examined and any additional changes made as necessary.
Deleting fields from records and pages does not remove the field definition itself and it does not remove the field from other areas, such as projects or message definitions.
In addition, this function does not delete the references to the field in the PeopleCode. You must manually remove the references to the deleted field. Use the Find In. . . tool to search for the field name you deleted.
Note:
Because performing this operation changes records, you must subsequently rebuild the project (alter tables).
Parameters
| Parameter | Description |
|---|---|
|
ProjectName |
The name of a project that is the source of records and pages to use. 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. |
|
FieldName |
The name of the field to be deleted. This name must be prefixed with the reserved word Field. |
|
ExclProj |
The name of a project that has pages that should be ignored by this function. |
Returns
A constant value. The values are:
| Value | Description |
|---|---|
|
%MDA_Success |
Bulk operation completed successfully. |
|
%MDA_Failure |
Bulk operation did not complete successfully. |
Example
&pjm = "MYPROJ";
&ret = BulkDeleteField(&pjm, Field.OrgId, "EXCLPROJ");
If (&ret = %MDA_Success) Then
MessageBox(0, "Metadata Fn Status", 0, 0, "BulkDeleteField succeeded");
Else
MessageBox(0, "Metadata Fn Status", 0, 0, "BulkDeleteField 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 at:
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 a 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.
Considerations Using the Exclusion Project
If you specify ExclProj, the following items that are both in ProjectName and ExclProj are not changed, that is, the field specified is not removed from these items:
-
pages
-
records
-
associated SQL with records of type View
-
any PeopleCode associated with those items.
Individual SQL or PeopleCode items are not ignored by themselves, only as associated with records or pages.