store selected list data in entity

0
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
asked
2 answers
2

Hi Payal,

  1. Have an helper object like ListSaveHelper, which can be a non-persistent entity
  2. Assume your entity you use in list view as ObjectA
  3. ListSaveHelper must be associated with ObjectA as *-* association, because NPE cannot have 1-* with persistent entity
  4. 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
  5. In the page where you show your list view, the page parameter must be the non-persistent entity
  6. And the list view can show ObjectA based on association from ListSaveHelper
  7. In the microflow for the save button, you can have ListSaveHelper as parameter
  8. So, within the save Microflow, get ObjectA (list view entities) from ListSaveHelper by association
  9. Using commit action, pass the entire list and save it. 
  10. 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.

answered
0

Hi Payal,

You can achieve this by adding following activities in a save microflow.

  1. Add an activity which creates a list of new entity.
  2. Now, Next add a loop which iterates over the list of objects of specific entity connected with listview
  3. 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.
  4. Then outside the loop , add commit activity to commit the objects in to the database.

I hope these steps will helps you to achieve it.

answered