Dear Tomek,
To create the view link between two tables its definition and fields should
be loaded. So instead of linking two dynamic view make static view using
entitymodel.xml file and link them.

Rishi Solanki
*CTO, Mindpath Technology*
Intelligent Solutions
cell: +91-98932-87847
LinkedIn <https://www.linkedin.com/in/rishi-solanki-62271b7/>


On Thu, Jan 25, 2024 at 8:39 PM Tomek <tom...@wp.pl> wrote:

> Hi,
>
> I would like to create two dynamic views and link with together. It is
> possible? I try like this:
>
> // Currently the following view can be replaced by entity
> // but I assume that it will be more complex.
> final DynamicViewEntity productFacilityView = new DynamicViewEntity();
> productFacilityView.addMemberEntity("PF", "ProductFacility");
> productFacilityView.addAliasAll("PF", "", new LinkedList<>());
>
> final DynamicViewEntity view = new DynamicViewEntity();
> view.addMemberEntity("PRD", "Product");
> view.addMemberEntity("PF", productFacilityView.getEntityName());
> view.addAliasAll("PRD", "", new LinkedList<>());
>
> final ModelKeyMap modelKeyMap = new ModelKeyMap("productId", "productId");
> final List<ModelKeyMap> maps = new LinkedList<>();
> maps.add(modelKeyMap);
> view.addViewLink("PRD", "PF", false, maps);
> final List<GenericValue> list =
> EntityQuery.use(delegator).from(view).queryList();
>
> But it does not work.
>
> Tomek
>
>

Reply via email to