New entities with default logical value for master entity in Master-detail

I have a Boolean field in my Order entity called “Invoiced”. and OrderLines contains the products and quantities etc. I want to save value FALSE to the logical field Invoiced by default when it is a new Order. When I am using CUBA Studio generated codes, what is the right plan that I should update this field, is it EntityListener or some other better place recommended? any further details will also be appreciated.

Look at the following section:
It explains various ways of setting initial values. The simplest for your case is just using a field initializer:

public class User extends StandardEntity {
    @Column(name = "ACTIVE")
    protected Boolean active = true;

And how to set in A class a default value from B class? It is one specified row in B.

Could you elaborate?

I created a new topic.