Cannot get unfetched attribute in Composition with various relations

Hello,

I’m having following problem with my current project: I have an entity with a composition in detailView. Starting from that composition there are various further relations to other entities. In the detailView I want to show this relations in the dataGrid of the composition entity. They are included in fetchPlan and they are shown correctly on open, and also after list_create of new composition elements. But after list_edit of an existing composition element I’m getting the unfetched attribute error.

I’ve made a small sample project for you: Project
Steps to reproduce the error:

  • run attached project
  • open “Customers” in menu
  • select “First Customer” (–> here all relations from the composition are loaded correctly (product, product category, category type))
  • edit “Order 1” from Composition
  • change “valid from” date and save

Do you have an idea what may be the problem?

Best regards,
Stefanie

Hi, Stefanie

Error in fetchPlan on customerOrderDetailView screen.
Your code:

<instance id="customerOrderDc"
                  class="com.company.composition.entity.CustomerOrder">
            <fetchPlan extends="_base">
            </fetchPlan>
            <loader id="customerOrderDl"/>
        </instance>

You have only the root attribute marked for download. And its reference attributes are not marked for download.
As a result, after editing, the Order will return to the Customers screen without the ProductCategory attribute loaded. But ProductCategory used on screen.

If you specify the necessary reference attributes in fetchPlan, the errors will disappear.

<instance id="customerOrderDc"
                  class="com.company.composition.entity.CustomerOrder">
            <fetchPlan extends="_base">
                <property fetchPlan="_instance_name" name="order">
                    <property fetchPlan="_base" name="orderProduct">
                        <property name="order">
                            <property fetchPlan="_base" name="orderProduct">
                                <property name="product">
                                    <property fetchPlan="_base" name="productCategory"/>
                                </property>
                            </property>
                        </property>
                    </property>
                </property>
            </fetchPlan>
            <loader id="customerOrderDl"/>
        </instance>

Dear Andrey,
thanks a lot for your time and help! :grinning: I was only focusing on the customerDetailView.
Best regards,
Stefanie