Create table from C/AL in Nav 2017

jensthomsenjensthomsen Posts: 171Member
Is it possible to create a table from C/AL, not data but the "real" table with fields and keys.

Answers

  • ShaiHuludShaiHulud Posts: 95Member
    In theory, if you're familiar with the C/AL code structure in text files, you could make a codeunit that writes all the C/AL code you design into a file, you then import that file and compile the object (through powershell or command line functions).
    I've seen this done with codeunits, but not with tables, though the type of object shouldn't matter as long as the code is correct.
    Arturas Kulsinskas
    NaviLogic
  • jensthomsenjensthomsen Posts: 171Member
    It would be so nice, if we were able to write directly to tables like 2000000041(Field), 2000000063 (Key) and 2000000038/2000000001, and create tables by inserting here. But as far as I can tell, these tables are all write-protected....

    Writing to a .txt file is a possibility, but also complex one. You have to handle each fields datatype correctly, and also the primary key....
Sign In or Register to comment.