KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Utility Method to Return Default Input or Output Form of a Table
PRODUCT: 4D | VERSION: 20 | PLATFORM: Mac & Win
Published On: December 9, 2025
Below is a utility method that will parse the catalog.4DCatalog file of a project mode database to return the default input form or default output form of a table.
#DECLARE($tableName_t : Text; \
  $getInput_b : Boolean; \
  $catalogPath_t : Text\
  )->$formName_t : Text

var $xmlRef_t; $xmlElemRef_t : Text

If ($catalogPath_t="")
   $catalogPath_t:="\\Project\\Sources\\catalog.4DCatalog"
End if

If (Test path name($catalogPath_t)=Is a document)
   $xmlRef_t:=DOM Parse XML source($catalogPath_t)
   If (OK=1)
     $xmlElemRef_t:=DOM Find XML element($xmlRef_t; "/base/table[@name=\""+$tableName_t+"\"]/table_extra")
     If ($getInput_b)
       DOM GET XML ATTRIBUTE BY NAME($xmlElemRef_t; "input_form"; $formName_t)
     Else
       DOM GET XML ATTRIBUTE BY NAME($xmlElemRef_t; "output_form"; $formName_t)
     End if
     DOM CLOSE XML($xmlRef_t)
   End if
End if