Tech Tip: TableColumns Implementation Changes
PRODUCT: 4D | VERSION: 20 | PLATFORM: Mac & Win
Published On: February 18, 2025
This tech tip addresses the implementation changes in the VP CREATE TABLE command across different 4D versions, specifically focusing on the TableColumns functionality.
In LTS and beta versions, the implementation uses TableColumn (note: previously TableColumns). Here's the correct syntax:
$options.tableColumns.push(cs.ViewPro.TableColumn.new("name"; "First name"; "dataField"; "firstName"))
$options.tableColumns.push(cs.ViewPro.TableColumn.new("name"; "Last name"; "dataField"; "lastName"))
$options.tableColumns.push(cs.ViewPro.TableColumn.new("name"; "Email"; "dataField"; "email"))
Current Release versions:
For the current versions 20R6 and 20R7, the implementation uses New Object. Here's the correct syntax:
$options.tableColumns.push(New object("name"; "First name"; "dataField"; "firstName"))
$options.tableColumns.push(New object("name"; "Last name"; "dataField"; "lastName"))
$options.tableColumns.push(New object("name"; "Email"; "dataField"; "email"))
Important Notes: