The easiest way to create a table the easiest way is by using snippets. To use snippets, Visual Studio Code needs to understand that our file is written in the AL language. This is simply done by saving the file with the .al extension. We will save our newly created file using File | Save and using a name that makes sense later. Let's use Radio Show.al for now:
Now, we can use the snippet called ttable. If we type in the letters tta, IntelliSense will suggest this snippet:
This snippet creates content for our file and sets the cursor on the place where we need to define the object ID:
We will type 50100 and use Tab to go to the next field, object name, where we will type "Radio Show".
The snippet has already created a field with the default ID of 1. The field name is MyField and the type is Integer. We will change the name to "No." and the type to Code [20].
The next field can be field number 2. Sometimes, it is useful to leave large gaps (such as jumping from 80 to 200 or 500) when the next set of fields has a particular purpose that isn't associated with the prior set of fields.
The Business Central online documentation says to not leave gaps in field numbers. Based on many years of experience, we disagree. Leaving numbering gaps will allow us to add additional fields between existing fields at a later date, if necessary. The result will be data structures that are (at least initially) easier to read and understand. Once a table is referenced by other objects or contains any data, the field numbers of the previously defined fields should not be changed.
The following screenshot shows our new table definition in the table designer: