KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
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.

    Current LTS and Beta Versions
    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:

  • Be sure to check your 4D version before implementing the code

  • The syntax difference is crucial for proper functionality

  • Both implementations achieve the same result but use different object creation methods