Unique article numbers from datagrid2

0
Hello, I would like to obtain unique article numbers from the "MAT CISLO" column in datagrid 2, for example into listview, and at the same time calculate the "NAFASOV" column. See attachment. Could someone show me how to proceed? Thank you.  
asked
2 answers
1

Hello Tomas,

 

It looks to me that you have kind productlines in your datagrid2 and on your right handsside have a summary of your productlines per product:

 

What I think you can do is to make an after commit flow on your product lines that fetch or create a product summary object and sums the number of products, you can do this within a microflow and use the aggregate list sum function.

 

Depending on your domain model it is maybe already possible to retrieve all the productlines over association product otherwise you need to retrieve your lines by xpath based on the id make sure if you have a lot of lines that you put an index on the id then.

 

Hope this helps!

 

Good luck

answered
1

Here an example:

 

Domain model simple:

image.png

After commit on ProductLine

image.png

ACO Microflow:

 

image.png

Sum action

image.png

Change ProductSummary:

image.png

 

Make also sure when you delete an entity that you set an event handler on deletion which basically would look the same as this example

 

Make sure that the product has a product summary entity for example with an FoC

 

answered