Hi All, I would like to build a microflow to add POLines to POHead. Background The user can create POLines without an POHead. I have created a Page with two columns: Column 1: Overview of POHead and associated datagrid with POLines. The user can create new POLines, that are associated with the POHead (works perfectly) Column 2: TemplateGrid with POLines which are not associated to a POHead. They are created in on a separat page. I would like to add a button "Add to PO", that adds the selected POLine to the POHead, selected in column 1. My approach Create a button on templateGrid to trigger a microflow; input parameter is the selected POLine Create an activity to identify the POHead shown in column 1. But, how to identify the selected POHead in the microflow? Is there s.th. similar to "listen to widget" function? Any suggestions are highly welcome :)
Put the 'unassociated' POLines templategrid inside of the Dataview that contains your POHead (Templategrids inside of a dataview do not have to contain data related to the dataview entity).
Create a microflow with 2 parameters - POHead and POLine. Microflow can set the POHead association on the POLine parameter with the passed in POHead object.
Put an Action button in the unassociated templategrid pointing to this microflow. The modeler will automagically map the dataview entity and record of the templategrid entity to the microflow
Now when you click a record in the unassociated templategrid, the association will be set and if you specified update UI in your microflow, the PORecord will disappear from the templategrid and appear in the datagrid of records associated with the PO.
You could use a wrapper entity that is set in a view arround both the grid with POHead objects and the POLines templateGrid.
On your POHead grid you add a action that is the default action when a user single clicks a POHead.
The microflow that gets called by the button sets an association to the wrapper. NB: Make sure you also set remember selection in the POHead datagrid.
Now you can also select lines on the POLines templategrid and use an action button on that grid to set the POLines on the selected POHead. By passing in the POLines selected and the wrapper object. Since the wrapper entity has an association set to the selected POHead you can retrieve that and set the selected POLines on that POHead.
The wrapper object can just be a non persistend entity because you won't need to store the temporary data in the database.