Hi Lea,
It's possible to get a list of fields for class via these 2 options:
Parse and analyze form definition
var dataClass = DataClassInfoProvider.GetDataClassInfo("your.custom.table.class.name");
var classDefinition = dataClass.ClassFormDefinition;
Look through "search settings" as a workaround
var dataClass = DataClassInfoProvider.GetDataClassInfo("your.custom.table.class.name");
foreach (var field in dataClass.ClassSearchSettingsInfos)
{
var fieldName = field.FieldName;
}