Same issue here. Only dirty workarounds are possible. I suggest a ticket referring to this question. How more up votes the more importance I hope..
I have the same problem, the same context, but for a different pupose: a self-referenced entity.
On the entity _NewEdit form, there is a tab showing all children.
I have a microflow that creates a new child, and I want the parent to be passed and pre-filled as default value at creation of the new child: this is only possible if I set the button on the Data view control bar of the entity_NewEdit form at the bottom, but that is not a logical place. If I place the button in the grid control bar of the childrens list, with
then I get the same error as you mention: “Cannot pass enclosing data view entity to microflow because it is related to the reference set selector entity.”
At first sight this seems like a bug as Mendix seems to be confusing data view entity an data grid entity because they have the same name. But I am keen to learn how I can make it work better... Other people must have experienced this same behaviour with self referenced entities...
I have experienced the same issue multiple times. And you can think of multiple work arounds but all involve changes to your model.
Allthough i never made a feature request out of this, imho they should change microflows on forms to have the same possibilities as when you call a microflow from a microflow.
That is being able to appoint an object to an input variable.