Pass enclosing attribute with a self-reference in a datagrid or reference-set-selector

13
When I make a self-reference to an entity and want to select the child-items with a datagrid or reference-set-selector with a microflow-button, I cannot pass the enclosing entity, which is the parent item. Error: “Cannot pass enclosing data view entity to microflow because it is related to the reference set selector entity.” One possibility is to put the microflow trigger outside the datagrid or reference-set-selector, but then cannot pass the selection. The goal in the end is to be able to restrict the selection possibilities by an attribute of the parent entity. All the selectable entities must have the same value in the attribute as the parent. Unfortunately it is not possible to make a XPath-constraint like “attribute = '[%CurrentObject%]'/attribute”.
asked
3 answers
4

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..

answered
3

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

  • pass data grid object: nothing
  • pass enclosing data view object: Yes

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...

answered
3

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.

answered