Search code examples
sqlpeoplesoft

Using meta tables to determine if a field in a record has a default value/


How can you determine the default value of a Record Field using a query? or a meta table? I can't seem to find a way for such.

Thanks for any help guys.


Solution

  • That information is stored in PSRECFIELD. The fields of interest are DEFRECNAME AND DEFFIELDNAME. If you have a constant default, the value will be in DEFFIELDNAME. If you are pulling the value from another record, then both will be populated.

    SELECT RECNAME, FIELDNAME, DEFRECNAME, DEFFIELDNAME FROM PSRECFIELD WHERE RECNAME = :1 AND DEFFIELDNAME <> ' ';