Wondering what is the best way to create CRUD operations, edit and browse screens where I would show and edit columns from multiple persistent entities.
Example, I have TABLE1 in the database with COLUMN1 and COLUMN2 and TABLE2 containing COLUMN3 and a reference to the first table TABLE1.
I would like to create a screen where COLUMN1, COLUMN2 and COLUMN3 are shown in a list, and in the edit screen for a selected entry - I would like to update the columns from the two tables.
I’m curious if this is possible and easy to implement?
This is of course possible. You should create a view for Entity2 (mapped to Table2) which includes Field3 (Column3) and the reference field. For the reference field, you also defines a view (it can be a nested one, very easy to create in Studio) including Field1 and Field2 of Entity1 (mapped to Table1).
After that, when creating screens for Entity2 by templates in Studio, select your view as “Browse view” and “Edit view”, and your screens will be created with the needed fields from both entities. Of course you will be able to add new attributes to the view later and display them on these screens if needed.
The process of creating and using views is demonstrated in the quick start video (approx. 1:30), see also this excellent article.
I’ve a question. I am having troubles, to add columns on browser screen. I’ve two entities, for example the classic client and order. I want show few fields columns of client entity into grid browser of orders. I created a view on order model and I used this view on screen browser. When I try to add column on grid order, I can see client field, if I select this and I run app, I see the column of client with the pattern set on instance of client model, then I’ve a columns that can group more fields, but how can I do add single column field of client entity ?