Prevent a "default value" checkbox being created with entity? I have a boolean field associated with my custom entity. The field itself is hidden in the entity form however when an instance of my entity is created a field record is generated with the default value. This is not the case for a text field i have, where if the field is hidden the field record is not created.

Basically this creation of a default boolean field is messing up my views further down the line.

How can i prevent a default value boolean field being autogenerated when hidden?

Thanks
Mathew
I am sure there are other (better )ways but the way i got around this issue, which fundamentally was about not having the default turn up in my views further down the line, was to implement a hook on hook_views_pre_view and show/hide the fields as i wanted:

function mymod_views_pre_view(ViewExecutable $view, $display_id, array &amp;$args)
{
  ...
  $fields[$field_name]['exclude'] = TRUE;
}


worked for me hope it helps someone else.