Count the Total number of items in a list at ONCE, categorizing each item to a category.

0
Hi..   I know this should be very simple to achive. Its just  can't get it done. Please try to help me as much as you can. Here is my problem. I have a Product List in an entity called "Final_Bill_Item_Info" which holds the Quantity of the products.  This Entity is associated to another enity called "Service_Items" which holds the product name. Now what i want is to Calculate the total quantity of Products in the "Final_Bill_Item_Info" categorising to the product name and update that information on another enity called "Test_Stock_2" . I have the folllowing microflow that works ok when run as an after commit and after delete event of the "Final_Bill_Item_Info" Entity.  The microflow updates each product quantity categorizing to the product name in the "Test_Stock_2" Entity.       But what I want is to calculate the same via an Action Button. When I run the microflow via an action button, only ONE Category name is updated in the "Test_Stock_2" entity.  It works if I place the Action Button in the tool bar of a Data Grid of the "Final_Bill_Item_Info" Entity. But again It only updates the selected Product in the data grid, NOT all of them at once. Is there any way, that I can update all the products at once via an Action button?? ** I have also used the "Ă„ggregate" fuction instead of the "Loop", but the result is the same...   Please HELP? Dylan
asked
2 answers
1

Dilan,

Suppose I have an entity called TestEntity

With a before commit event handler like this:

If I create a page with a datagrid that points to this entity, like this

I can then create a microflow that accepts a list of TestEntity objects, like this:

Now if I want my users to be able to commit all objects displaying in the datagrid, I add an action button to the datagrid that calls this microflow:

when the user clicks this action button, all objects in the datagrid will be passed to the microflow and committed, which will execute the before commit microflow for all of these objects using a single microflow.

You can see this by clicking Edit next to Microflow settings:

If I want my users to be able to select which objects to commit, but still commit a list of objects, on the datagrid, I can change the datagrid properties to enable either Multi-selection or Simple Multi-selection, as shown below:

Hope that helps,

Mike

answered
0

Dilan

Create another microflow that accepts a list of Final_Bill_Item_info objects.  In the microflow, use a commit action to commit the list of objects passed in ( be sure to specify with events in the commit action).  Next, call this microflow using an action button in the control bar of a datagrid pointed at this entity.  When you configure this action button, you will see that it passes in all rows of the datagrid (if the datagrid is configured for single select) or all selected rows (if the datagrid is configured for multiple select).

Hope that helps,

Mike

answered