How to link data from different entities?

Hello all, How can I link data from different entities? I associated my Product entity to my Stock entity and when I open the 'NewEdit' page of my StockProduct entity, I want to select a Product and then fill in the Stock attribute automatically from the data of the Stock entity. Is this possible? Thanks
2 answers

If you have an assocation from product to stock there is no direct need to copy attributes unless for conditional visibility. In all forms and grids you can show data from assocatiated entities.

If you really need this you can do this in the 'on change' event of the product selector or in a custom save action.

On change: retrieve the product from stockproduct over association, copy the attribute and refresh the stockproduct.


The answer depends on what exactly you're asking. If you're literally asking if you can show data from entity A in a data view of entity B then there are any number of ways to do that.

The simplest way is to just create a text box and select an attribute over an association instead of an attribute of the data view target. This will automatically update if you select a different object A from a reference selector or by any other means. If you're looking for a more versatile solution you can simple nest a second data view inside the first and select association as a data source.