Hi, I have a list view and one save button. whatever data present in that list view on click of save button I want to store that data in one entity in a microflow. How can I do this? Thanks in Advance
Have an helper object like ListSaveHelper, which can be a non-persistent entity
Assume your entity you use in list view as ObjectA
ListSaveHelper must be associated with ObjectA as *-* association, because NPE cannot have 1-* with persistent entity
I am not sure how or where you create those entities (ObjectA) to be shown in list view, but when you create you can associate them with Non-peristent entities
In the page where you show your list view, the page parameter must be the non-persistent entity
And the list view can show ObjectA based on association from ListSaveHelper
In the microflow for the save button, you can have ListSaveHelper as parameter
So, within the save Microflow, get ObjectA (list view entities) from ListSaveHelper by association
Using commit action, pass the entire list and save it.
You must also delete the ListSaveHelper at the end of microflow, to make sure it can be garbage collected later.
The looping is needed only if you want to process your ObjectA (list view entities) in the microflow.
The approach suggested by Stella works only if you are passing the entity used in list view as a List parameter. But if you are using list view, it is not possible to multi-select which is needed to pass the list parameter to the MF. Only single select action is possible.
Multi-Select is possible only with data grid or template grid, with this, you can pass multiple selected items and use the approach suggested by Stella.
You can achieve this by adding following activities in a save microflow.
Add an activity which creates a list of new entity.
Now, Next add a loop which iterates over the list of objects of specific entity connected with listview
Inside the loop, Create a new object of new entity and copy the attributes and then followed add the newly created object in to the newly created list.
Then outside the loop , add commit activity to commit the objects in to the database.