File Layout Peoplecode Peoplesoft

Posted on by
File Layout Peoplecode Peoplesoft

If your data is hierarchical in nature, or based on existing PeopleSoft records or pages, you want to use a File Layout definition for reading and writing your data, rather than doing it line by line (or field by field.) For example, suppose you wanted to write all the information from a record to a file. You can use the WriteRecord method to write all the data from the record, instead of having to loop through every field, find the value, and write it to the file. In addition, you could write all the information from a transaction (or several transactions) from a page to a file. Each transaction can be considered a rowset. A rowset can contain more than one record and is generally composed in a hierarchical structure. You could create a File Layout definition that has the same structure as the page (or component), and use the WriteRowset method. If you have a file that contains data in the correct format, you can use the ReadRowset method to read the data from the file to the page.

Each file layout is associated with a format. This format specifies the type of data in the files.

You specify the format as part of the File Layout Properties. You can only specify one format for a file layout. Available formats are: • FIXED (default) • CSV • XML The file layout methods and properties use this information to handle each file type in a transparent manner. Generally, you don’t need to do anything different based on file type. Any exceptions are noted in the documentation. Note: Unlike other PeopleTools definitions, records and field are copied to a File Layout definition. There are no pointers.

This means if you change a record definition (add or remove a field) you must change the File Layout definition also. The changes are not automatically propagated. This is why the documentation refers to these elements as file records, file fields, and so on, to show that they are no longer part of the original definition they were created from. PeopleSoft recommends regenerating all file layout definitions after any upgrade, to avoid any corruption caused by changes to the database. See Using Standalone Rowsets for more examples of writing from and reading to files using File Layout and standalone rowsets.

Create the record to insert data into (for example MY_FILETEST) Create file layout by dragging the test record on to the file layout Create XML file to. Tenchu Z Pc here.

Image: Example File Layout definition (ABS_HIST) In the following example, the File Layout definition is based on the record ABSENCE_HISTORY, and looks like this: You should note the following about the using the WriteRecord method: • Not all the fields in the File Layout definition and the record have to match. The WriteRecord method, like all File Layout methods, applies only to the like-named fields. Tinkerbell Pictures. If there are additional fields in the record or in the File Layout definition, they are ignored. • The WriteRecord method writes only to like-named records. If you rename a record after you use it to create a File Layout definition, you must rename it to the exact same name in your File Layout. Because WriteRecord writes like-named records, the same file layout definition can contain more than one record. • The WriteRecord method takes a record object as its parameter.

Macromedia Flash Mx 2004 Portable. A populated record object references a single row of data in the SQL table. This is why a SQL Fetch statement is used in a condition around the WriteRecord method. This fetches every row of data from the SQL table, then writes it to the file.