Retrieve via association not returning expected value
Hi All, I have a scenario with 3 reference selectors. All 3 have unique source entities associated to the same containing entity. In this design, the selectable objects for the 2nd selector is sourced by microflow that uses the selection in the 1st selector as a parameter of a rest call (there is some data filtering as well before the set of objects is returned). The 3rd selector’s selectable objects has a similar design in that it takes the selected objects from the 1st and 2nd and uses an attribute from both as a parameter in a rest call to produce the list of objects to select. There is also an on-change microflow used to refresh the containing entity for the 1st and 2nd selectors. The issue here is that in DS microflow for the 2nd selector, we check to see if there is already a selection made so that it can be included in the set of returned selectable objects, but even when there is one selected, the retrieve via association from containing entity is returning empty. It doesn’t seem to happen all the time but it’s happening enough to be an issue. Even when stepping through with the debugger, I can see the containing entity has a valid reference in the variables panel, but the retrieval action still returns empty. I’ll try to include some helpful images. Thanks for any and all suggestions! Containing Entity: “LocationSearchHelper” 2nd Selector’s Source Entity: “RouteCodeHelper” *Just to update, the solution I ended up finding was just to upgrade to latest version of mendix. The problem I described was happening in 9.16.1, not sure if it had been documented before but the upgrade to 9.24.2 seemd to resolve my issue. Thanks to everyone who took the time to respond*
Ok so things I would check in this scenario are:
- Is the security setup correctly? Does your user have read/write access on the association(sometimes even though you wouldnt think you need write, this still could cause the issue)
- Does your Datasource microflow trigger at the correct moment? Or does it trigger twice for example? Then check the refreshes that you use of the main object.
- Possibly check if your setup does need a commit at some point.
Hope this helps!
How is the onchange logic setup? The onChange flow for the first and second selector should refresh LocationSearchHelper
Just to update, the solution I ended up finding was just to upgrade to latest version of mendix. The problem I described was happening in 9.16.1, not sure if it had been documented before but the upgrade to 9.24.2 seemd to resolve my issue. Thanks to everyone who took the time to respond!