KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Completely Deleting a Field
PRODUCT: 4D | VERSION: 14.1 | PLATFORM: Mac & Win
Published On: December 23, 2014

When deleting a Field from a Table in a structure only the field is removed, however the data still exists in the datafile. This data can resurface when creating a new field that shares the same reference number as the deleted field.

Note: Reference numbers are touched upon in the following Tech tip
Finding Table And Field Numbers


The image below shows the intial table and sample data, notice that Field_2's reference number is 2.


Field_2 is deleted and as expected the data is no longer displayed.


Adding a new field, Field_4, to the table it is assigned to referece number 2 and as seen below the data resurfaces.


To avoid this problem, after deleting the field perform an Advanced Compact from the MSC with the "Force updating of the records" and "Compact address table" settings set.


Opening the datafile and adding Field_4 does not display any old data,


This will also prevent problems with PK fields that are created with field reference numbers that used to refer to a deleted field.