Trying to show associated attributes in Data Grid with data source microflow

0
I have a page with a Data View and a listening Data Grid. The Data source of this data grid is a microflow.   This works fine, except when I try to add new columns from associated attributes. I get the following message: A grid with data source 'microflow' cannot have attribute paths in its columns.   Edit: Domain model:  I created a report page where I count the total number of orders per combination of 3 associated attributes (Material, ShippingPoint & ShipTo) This results in the following page: When I select a record in the above report I need to create an overview of the corresponding Sales Orders. For example: If I click on the 3rd row I would expect to have a result of 4 Sales Orders. This works! The result is shown in the page Order_Overview where I created a Data view of the entity Report and a Data Grid which has the foloowing microflow as datasource:   The result is shown in the following page where I want to show the Sales Orders, but also the associated attributes from the entities Material, ShipTo & ShippingLocation  
asked
2 answers
5

What is your question? The modeler tells you that you can't do this. The reason is that in the microflow, only the objects you want to display are retrieved. These objects do not contain attributes of other entities, so you cannot show them. When you retrieve objects by XPath, you perform an SQL query which can do joins, so you can access attributes from other entities.

 

A workaround could be to duplicate your data, so that you can display it.

Otherwise, you should ask yourself if the datasource microflow is really necessary: many problems can be solved by XPath constraints. If you edit your post with your use case, we could suggest an XPath query.

 

EDIT:

You can solve this using XPath: add the following constraints to your data grid.
[ModuleName.Orders_ShippingPoint/ModuleName.ShippingPoint/ModuleName.ShippingPoint_Report = '[%CurrentObject%]']
[ModuleName.Orders_ShipTo/ModuleName.ShipTo/ModuleName.ShipTo_Report = '[%CurrentObject%]']
[ModuleName.Orders_Material/ModuleName.Material/ModuleName.Material_Report = '[%CurrentObject%]']

 

Now, because you are using XPath retrieve, you can show the relevant attributes.

answered
3

That's simply the limitation when using a microflow datasource. This also exists when working with lists over association (so from memory, not database), where I believe the limit is that you can only go 1 association deep.

Depending on what you need and your specific situations there are two alternatives I can think of:

  1. Use a database (XPATH) datagrid where you show the lines you need to have visible in the datagrid by making use of an XPath constraint that refers to your dataview object with the use of [%CurrentObject%]. Note: for any of the objects you have linked to the Report entity that you wish to display, it becomes necessary that the association to Report has been committed. Also, the Report object must be committed for it to be available in the database so you can reference it in the XPath as the current object.
  2. Create an intermediary (helper) object where you for example create a reference set to the lines you want to appear in the datagrid. You could simply show these objects over association, so there would be no need to commit the associations.

Option 1 can ofcourse also be implemented with the help of an intermediary (helper) object as outlined in option 2.

If you provide us more information on your model and how the datagrid lines are being populated in your microflows, we can provide you with more specific pointers.

Edit: Ofcourse Rom beat me to it :-)

answered