Adding File Records and File Fields
You can add file records and file fields to your file layout in two ways:
-
Base them on existing record and field definitions in the database.
-
Construct them directly in the file layout without reference to any database records or fields.
A file record that you construct in this way is added as a segment, but the result is an ordinary file record.
You can use both methods in any combination when creating file records and file fields in a file layout definition. Each file record and file field is generically referred to as a node.
Important:
Regardless of the method that you use, file records and file fields exist only as definitions within a file layout and have no connection with any database record or field. Even with file records based on records in the database, a change to the database record definition is not reflected in the file layout.
After any update to PeopleTools, you should regenerate all file layout definitions.
Using a Segment Instead of a Record
Suppose that in the file that is provided to you, some of the file records contain new data and must be inserted, while others contain data that updates existing data. You can add a segment with a single field (like AUDIT_ACTION) that indicates whether the file record is new or changed. When you process the file, you can use PeopleCode to look at this field and, based on its value, perform the appropriate action.
As another example, suppose that you want to include only two fields from the PERSONAL_DATA table in the file. You have two choices: insert the PERSONAL_DATA table and manually delete all of the unwanted fields or insert a segment, name it PERSONAL_DATA, and then insert the two fields that you want.
Using Segments in Data Interchanges
If you create a file layout for a data interchange, you can use segments, but each file record must correspond to a record with the same name in the PeopleSoft database, and its file fields must have the same names and data formats as the fields of the database record. The file record can contain a subset of the fields in the corresponding database record. It can also contain a subset or a superset of the fields that are provided in the corresponding file data.
Adding File Records
To add a file record to the file layout definition, use one of the following methods:
-
Drag and drop a database record.
Drag a record definition from the project window into the definition window of the file layout. When dropping a record from a project onto a file layout definition, keep these items in mind:
-
If you drop the record onto the root node, it becomes the first top-level segment of the target root node.
-
If you drop the record onto a segment, it becomes a segment on the same level as the target segment, immediately following it in the order.
-
If you drop the record onto a file field of segment, it becomes the first child segment of the target segment.
-
The system inserts all of the constituent fields of the dragged record as well.
-
Whether a node is currently selected does not matter. The system only considers the location of the cursor when you drop the record (the drop site) in determining the placement of the resulting segment.
-
-
Insert a database record.
With the root node or a file record highlighted, selectWhen you select a record, the new file record appears following the highlighted file record and at the same level. The system automatically inserts all of the constituent fields of the record as well.
-
Insert a segment.
With the root node or a file record highlighted, select and enter a file record name. When you click OK, the new file record appears following the highlighted file record and at the same level.
-
Insert a child segment.
With a file record highlighted, select and enter a file record name. When you click OK, the new file record appears one level below the highlighted file record but before any others at that level.
Note:
When you add a file record at the root level, it appears immediately below the root node, before all of the other file records.
Adding File Fields
To add a file field to the file layout definition, use one of the following methods:
-
Drag and drop a database field.
Drag a field definition from the Project window into the Definition window of the file layout, dropping it on any existing file record or file field. Confirm the field name or enter a different one, and click OK. The new file field appears following the node that you dropped it on.
-
Insert a database field.
With a file record or file field highlighted, select Confirm the field name or enter a different one and click OK. The new file field appears following the highlighted node.
-
Insert a file field.
With a file record or file field highlighted, select and enter a file field name. When you click OK, the new file field appears following the highlighted node.
Note:
Each file field must have a unique name within its parent file record, but file fields in different file records can have the same name.