Hello there. I'm trying to open a form from java by using addOpenFormFeedback. All works fine, but I'd like to open a form with a datagrid and put a constraint on the grid. I have no luck so far... What I'm doing is the following: I retrieve a bunch of IMendixObjects in a list with Core.retrieveXPathQuery This returns 4 Objects I put the IMendixIdentifiers of those 4 Objects in an ArrayList of type IMendixIdentifier and put one of those id's in a variable because I have to pass an id as a parameter and cannot pass null. Then I call addOpenFormFeedback with the following parameters: addOpenFormFeedback(theformpath,sometitlestring,targettypemodal,theidofthefirstoffour,arraylistwithids) This opens the correct form, but there is no constraint set. It just shows me all available objects. My thought was I'm passing the wrong id as the 4th parameter, but I'm not sure what id this should actually be. Or maybe I'm just misunderstanding the meaning of constraints in this function?
These constraints are indeed not the ids that should be shown but a legacy context mechanism for setting some associations 'automagically'. You can read about it here but I would not recommend using it now, and anyway it's not relevant to your current issue.
What you're trying to achieve is not so straightforward now. What you could do is create a container entity that associates with the entity of your search results, create an instance of this entity and set the associations and then show a dataview of your container entity and show a datagrid over the association you just filled.
A different way would be to fill your datagrid using a microflow source and return the objects in your microflow (optionally through a java action) but there are some restrictions in what you can do with grids filled by microflows.