Is there a known way to update 2 different entities from a single editor, the example is as following:
I Have an entity called Customer that has the following attributes:
Name : String
Birth Date : Date
Currency : String
I Have another entity called CustomerLocation that has the following attributes which are updated from a different editor:
1.Customer : Reference
2.Address : String
3.Contact : String
4.Main Location : Boolean
Only one location can be marked as main location for a single customer, is there a way to virtually have single editor called Customer with the following attributes:
Name: String
Birth Date: Date
Currency: String
Address : String
Contact: String
the user will primary use the new editor to insert/update customers and updates the customer main location, and in minor cases the user will still use the CustomerLocation Editor only if a particular customer have multiple locations.
In the backend of the virtual editor, i want to insert/update a customer and insert/update a main customer location.
my question is, can i do this type of editor in Cuba and how?
Yes, you can do it. There is a sample project with new CUBA 7 screens. But pay attention, that there is no any consistency checks of the model, only the screens.
First of all, look at editor screen descriptor. It uses two data containers, one for Customer and one for CustomerLocation. locationDc is a collectionContainer as the Customer can have not any location (or you need strong consistency checks otherwise).
The data is displayed with a form component. I specified main form data container and locationDc as data container for address and contanct fields.