A datagrid has some built in event triggers (New, Edit, Delete), and also offers the ability to trigger a microflow by placing a microflow button in the control bar. The microflow button will call a microflow that you specify and can pass in:
In addition, there are several properties of the microflow button that may help you accomplish what you need to. Look in the properties pane with the microflow button selected.
Hope that helps,
Bernard, This is nothing new, what Mike has mentioned above, but still let me try.
If i understand correctly then you want to have 1) dataview which listens to a datagrid 2) have a microflow trigger/button to send the selected entity. This can be done easily. Please see the reference documentation for more information.
For 2nd part get a microflow trigger in the data view form. While configuring the trigger just add to sent the selected entity.
Please let me know if you need more information. Thanks
Bernard, as per your requirements you can add a microflow trigger in the control bar of the datagrid and make it a 'default button' plus you can change the 'visibility' of the same as per your choice. Please go through the documentation and check https://world.mendix.com/display/howto40/Configure+the+default+button+of+a+data+grid
Moreover, you can use the same microflow or the other to pass on the selected entity(parameter) and perform operations over the selected entity or the associated one's based on requisite..
Though i hope this will help you otherwise i would request you to be a little bit more specific about your question because you asked for an execution of a microflow without any button/trigger which is truly a tough nut to crack for me because am also in the middle of learning :)
To trigger an microflow when data grid selection changes you need several things:
- A data view with a “Listen to widget” datasource set to that grid – the grid listener.
- A data view inside that view that has a nano/microflow as the datasource having the grid entity as the parameter and returning some data object. When nothing is selected the parameter value is empty
When selection changes the nano/microflow is called. Beware that it’s be called 3 times.
To setup the conditional visibility on the data grid buttons based on selection you need extra things:
- A helper entity that will hold the current selection (or a boolean flag). The entity must have an association with the entity we’re working on.
- Enclose the grid and grid listener with two extra data views. The outer data view will create and associate the helper entity with the current object. The inner data view will get the original current object from the helper entity by association. Now we have both objects in context.
- In the grid listener nano/microflow add the helper entity as a parameter and set the attributes of the helper object based on the current selection
- In the grid buttons setup conditional visibility based on the attributes of the helper object.