Showing posts with label Records and Fields. Show all posts
Showing posts with label Records and Fields. Show all posts

How to Find the Record Type of a Record in PeopleSoft

How to Find the Record Type of a Record in PeopleSoft
This simple SQL will show you how to find basic information about a record type.
SELECT RECNAME,
DECODE (RECTYPE,
     0, 'SQL Table',
     1, 'SQL View',
     2, 'Derived',
     3, 'Sub Record',
     5, 'Dynamic View',
     6, 'Query View',
     7, 'Temporary Table',
     'Unknown') As RecordType,
RECDESCR,
PARENTRECNAME,
AUDITRECNAME
FROM PSRECDEFN WHERE RECNAME = 'ACAD_PROG'; --Record Name

How to use USEEDIT field to find out Record Field Properties in PeopleSoft

How to use USEEDIT field to find out Record Field Properties in PeopleSoft
This handy SQL script will provide how to find Record Field properties such as Key Fields, Edit Fields, Default values etc.. of a Record. Presented here are two versions of SQLs. First one give is quite simple and give you enough information about record field properties of a record and it uses PSRECFIELD tools table. Second one is bit complex and will give you more in-depth information such as last update datetime and operator id, etc..

Side Note: The SQLs are using Oracle Function BITAND. Also if you want to know more info about USEEDIT field please click here.
USEEDIT field assigns a decimal value to each individual bit value.

SQL 1 (simple)

SELECT
  FIELDNAME,
  DECODE(BITAND(USEEDIT, 1), 1 ,'Y', DECODE(BITAND(USEEDIT, 16), 16, 'Alt')) as Key,
  DECODE(BITAND(USEEDIT, 2048),2048 , 'Y' , '') as Search,
  DECODE(BITAND(USEEDIT, 32), 32 ,'Y','') AS List,
  DECODE(BITAND(USEEDIT, 256), 256 ,'Y','')AS Req,
  DECODE(BITAND(USEEDIT, 512), 512 ,'Xlat', DECODE(BITAND(USEEDIT, 8192), 8192 ,'Y/N', DECODE(BITAND(USEEDIT, 16384),16384 ,'Prompt',''))) AS Edit,
  EDITTABLE, DEFFIELDNAME
FROM PSRECFIELDDB
WHERE
  RECNAME = 'ACAD_PROG' --Record Name
ORDER BY FIELDNUM;

SQL 2 (complex)

SELECT A.recname,        A.fieldname,
       CASE
         WHEN B.fieldtype = 0 THEN 'CHAR'
         WHEN B.fieldtype = 1 THEN 'LONG CHAR'
         WHEN B.fieldtype = 2 THEN 'NUMBER'
         WHEN B.fieldtype = 3 THEN 'SIGNED NBR'
         WHEN B.fieldtype = 4 THEN 'DATE'
         WHEN B.fieldtype = 5 THEN 'TIME'
         WHEN B.fieldtype = 6 THEN 'DATETIME'
         WHEN B.fieldtype = 7
               OR B.fieldtype = 8 THEN 'IMAGE'
         ELSE NULL
       END           AS FIELDTYPE,
       CASE
         WHEN B.fieldtype = 2                OR B.fieldtype = 3 THEN Trim(To_char(B.length))                                       || '.' || To_char(B.decimalpos)
         ELSE To_char(B.length)
       END           AS FLDLEN,
       CASE
         WHEN Bitand(A.useedit, 256) > 0 THEN 'YES'
         ELSE 'NO'
       END           AS REQ,
       CASE
         WHEN Bitand(A.useedit, 1) > 0 THEN 'KEY'
         WHEN Bitand(A.useedit, 2) > 0 THEN 'DUP'
         WHEN Bitand(A.useedit, 16) > 0 THEN 'ALT'
         ELSE NULL 
       END           AS KEY_TYPE, 
       CASE 
         WHEN Bitand(A.useedit, 64) > 0 THEN 'DESC' 
         WHEN ( Bitand(A.useedit, 1) > 0 
                 OR Bitand(A.useedit, 2) > 0 
                 OR Bitand(A.useedit, 16) > 0 ) 
              AND Bitand(A.useedit, 64) = 0 THEN 'ASC' 
         ELSE NULL 
       END           AS DIR, 
       CASE 
         WHEN Bitand(A.useedit, 2048) > 0 THEN 'YES' 
         ELSE 'NO' 
       END           AS SRCH, 
       CASE 
         WHEN Bitand(A.useedit, 32) > 0 THEN 'YES' 
         ELSE 'NO' 
       END           AS LIST, 
       CASE 
         WHEN Bitand(A.useedit, 4) > 0 THEN 'YES' 
         ELSE 'NO' 
       END           AS SYS, 
       CASE 
         WHEN Trim(A.defrecname) = '' THEN A.deffieldname 
         ELSE Trim(A.defrecname) 
              || '.' 
              || A.deffieldname 
       END           AS DEFAULT_VALUE, 
       CASE 
         WHEN Bitand(A.useedit, 8) > 0 
              AND Bitand(A.useedit, 128) = 0 
              AND Bitand(A.useedit, 1024) = 0 THEN 'A' 
         WHEN Bitand(A.useedit, 8) > 0 
              AND Bitand(A.useedit, 128) > 0 
              AND Bitand(A.useedit, 1024) = 0 THEN 'AC' 
         WHEN Bitand(A.useedit, 8) > 0 
              AND Bitand(A.useedit, 128) > 0 
              AND Bitand(A.useedit, 1024) > 0 THEN 'ACD' 
         WHEN Bitand(A.useedit, 8) = 0 
              AND Bitand(A.useedit, 128) > 0 
              AND Bitand(A.useedit, 1024) = 0 THEN 'C' 
         WHEN Bitand(A.useedit, 8) = 0 
              AND Bitand(A.useedit, 128) > 0 
              AND Bitand(A.useedit, 1024) > 0 THEN 'CD' 
         WHEN Bitand(A.useedit, 8) = 0 
              AND Bitand(A.useedit, 128) = 0 
              AND Bitand(A.useedit, 1024) > 0 THEN 'D' 
         ELSE NULL 
       END           AS AUDT, 
       CASE 
         WHEN Bitand(A.useedit, 16384) > 0 THEN 'PROMPT' 
         WHEN Bitand(A.useedit, 512) > 0 THEN 'XLAT' 
         WHEN Bitand(A.useedit, 8192) > 0 THEN 'Y/N' 
         ELSE NULL 
       END           AS EDIT, 
       A.edittable   AS PROMPT_TABLE, 
       A.setcntrlfld AS SET_CONTROL_FLD, 
       CASE 
         WHEN Bitand(A.useedit, 4096) > 0 THEN 'YES' 
         ELSE 'NO' 
       END           AS REASONABLE_DT, 
       CASE 
         WHEN Bitand(A.useedit, 32768) > 0 THEN 'YES' 
         ELSE 'NO' 
       END           AS AUTO_UPDT, 
       CASE 
         WHEN Bitand(A.useedit, 262144) > 0 THEN 'FROM' 
         WHEN Bitand(A.useedit, 524288) > 0 THEN 'THROUGH' 
         ELSE NULL 
       END           AS SEARCH_FIELD, 
       CASE 
         WHEN A.subrecord = 'Y' THEN 'YES' 
         ELSE 'NO' 
       END           AS SUBRECORD, 
       A.lastupddttm, 
       A.lastupdoprid 
FROM   psrecfield A, 
       psdbfield B 
WHERE  A.recname = :1 --paste recname here 
       AND A.fieldname = B.fieldname 
ORDER  BY fieldnum; 

How to Travel through all the records and fields all levels in a component

How to Travel through all the records and fields all levels in a component
Travel through all the records and fields all levels in a component This is a typical peoplecode example for traverse through all the records and fields in a component This might be handy when you want to troubleshoot. 
/* Get the parent Level 0 rowset */ Local Rowset &Parent = GetLevel0(); Local number &I, &J, &K, &L; Local Rowset &RS; Local Row &RowChild; Local Record &Rec; For &II = 1 To &Parent.ActiveRowCount /* To get the number of child rowsets of the row */ For &I = 1 To &Parent(&II).ChildCount /* Get each rowset*/ &RS = &Parent(&II).GetRowset(&I); /* For each rowset each ActiveRowCount */ For &J = 1 To &RS.ActiveRowCount /* Get the each row for each rowset */ &RowChild = &RS.GetRow(&J); /* For each row, how many records */ For &K = 1 To &RowChild.RecordCount &Rec = &RowChild.GetRecord(&K); /* show each Record Name */ WinMessage(&Rec.Name, 0); /* if record has changed show a message */ If &Rec.IsChanged Then WinMessage("this record is changed " | &Rec.Name, 0); /* Go through fields */ For &M = 1 To &Rec.FieldCount If &Rec.GetField(&M).IsChanged Then /* If field has changed show a message */ WinMessage("this field is changed " |  
&Rec.GetField(&M).Name | " value " | &Rec.GetField(&M).Value, 0); End-If; End-For; Else WinMessage("this record is not changed " | &Rec.Name, 0); End-If; End-For; End-For; End-For; End-For;

PeopleSoft Application Designer Practices

This is pretty good and very informative resource who are newbies to PeopleSoft and want to learn PeopleSoft Application Designer which is the main development tool used to build and modify PeopleSoft applications. This presentation describes main (nine) steps for creating a PeopleSoft application. This presentation is done by Yes-V Software Solutions.
This will walk through step by step of how to create PeopleSoft Application Designer definitions, including:
•    Fields
•    Records (Tables)
•    Pages
•    Components
•    Menus

you can find the link here;
http://www.scribd.com/doc/29693050/PeopleSoft-Application-Designer-Practice

Record Fields and the Component Buffer

Record Fields and the Component Buffer
This is taken directly from peoplebooks;
The record fields in the component buffer are a superset of those accessible to the user through page controls. In most cases, PeopleCode can reference any record field in a scroll area’s primary scroll record or in a related display record, not just those fields that are associated with page controls. The following table lists record types and locations:
Type and Location of Record
Presence in Component Buffer
Primary record on scroll levels greater than zero
On scroll levels greater than zero, all record fields from the primary scroll record are in the component buffer. PeopleCode can refer to any record field on the primary scroll record, even if it is not associated with a page control.
Primary record on scroll level zero
If scroll level zero of a page contains only controls associated with primary scroll record fields that are search keys or alternate search keys, then only the search key and alternate search key fieldsave in the component buffer, not the entire record. The values for the fields come from the keylist, and the record cannot run RowInit PeopleCode. If level zero contains at least one record field from the primary scroll record that is not a search key or alternate search key, then all the record fields from the primary scroll record are available in the buffer. (For this reason, you may sometimes need to add one such record field at level zero of the page to make sure that all the record fields of the level-zero primary record can be referenced from PeopleCode.)
Related display record fields
The buffer contains the related display record field, plus any record fields from the related display record that are referenced by PeopleCode programs. You can reference any record field in a related display record.
Derived/work record fields
Only derived/work record fields associated with page controls are in the component buffer. Other record fields from the derived/work record cannot be referenced from PeopleCode.
Translate table record fields
Only Translate table fields associated with page controls are available in the component buffer. Other fields from the Translate table cannot be referenced from PeopleCode.