Generate edit and browse screens using columns from multiple entities

Hi there,

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?

Thanks in advance.
Sandra

1 Like

Hi Sandra,

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.

1 Like

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 ?

If I understand you correctly, you should add the client’s attribute after the dot when defining the table column, like this:
image

You even have code completion in the id field: try to press Ctrl+Space after the dot

1 Like

thanks for solution :slight_smile: