KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Hiding all forms in the 64-bit Label Editor
PRODUCT: 4D | VERSION: 16 R6 | PLATFORM: Mac & Win
Published On: June 15, 2018
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

By default, the 64-bit Label Editor will show the table forms that are associated for each table like for example:



As a developer, one may not want to display all the table forms to the user. A way to control this is to use the "labels.json" file to select what to display manually. If the developer wants to immediately them all, the following utility method will hide all forms for all tables without modifying each table manually:

// ----------------------------------------------------------------------
// Name: HIDE_ALL_FORMS_IN_LABEL_EDITOR
// Description: Method will hide all forms that will display in the Label
// Editor 64-bit.
// ----------------------------------------------------------------------
C_LONGINT($i;$numOfTables)
C_OBJECT($obj)
C_TEXT($jsonText)
C_Time($vhDoc)
ARRAY OBJECT($masterObj;0)

$numOfTables:=Get last table number

For ($i;1;$numOfTables)
 OB SET($obj;"tableId";$i;"forms";"[]";"methods";"[]")
 APPEND TO ARRAY($masterObj;$obj)
 CLEAR VARIABLE($obj)
End for

$jsonText:=JSON Stringify array($masterObj)
$jsonText:=Replace string($jsonText;"\"[]\"";"[]")
$loc:=Get 4D folder(Current resources folder)+"labels.json"

If (Test path name($loc)=Is a document)
 text to document($loc;$jsonText)
Else
 $vhDoc:=Create document($loc)
 If (OK=1)
  SEND PACKET($vhDoc;$jsonText)
  CLOSE DOCUMENT($vhDoc)
 End if
End if


Here is when all the tables forms are hidden:




Note: Deleting the "labels.json" file can revert back to displaying the default of all the table forms.


See Also: