Here is a small script that modifies the data type to string
when computed fields have their expression starting with enum
.
procedure OnColumnGenerated(Args: TColumnGeneratedArgs);
var
Expr: string;
begin
Expr := Args.DBField.Expression;
if LowerCase(Copy(Expr, 1, 5)) = 'enum(' then
begin
Args.Field.FieldType.BaseType := 'string';
Args.Prop.PropertyType.Basetype := 'string';
end;
end;