Maybe this is related to the 7.23.4 version, but in the 7.23.5 version I created this in a test project:
This will retrieve or create the counter object when opening the home page via the home menu, navigating to the app or when using a show homepage action.
In the test project I did not use security and this might be the issue in your case with security turned on. Check the permissions for the HomePageCounter entity, maybe the user does not have permissions to access this entity?
Hope this helps in finding a solution.
Thank you Erwin! I’ve made a test project in Mendix 7.23.4 myself (with security on) and now I see that when I navigate to the Home microflow using the menu option, the object made earlier is found. But when I press F5 or refresh the browser session by pressing enter at the URL in the browser, then the object is not found in the session anymore.
In my “real” project the user navigates away from the Home microflow to retrieve an OAuth token form an external website and is then redirected to the Mendix site again. In that situation apparently the session data is lost.
I will solve it by storing the counter in the database and have it cascading delete with the session.
We have the same issue in our current project. In our navigation flow we retrieve an NPE object over the current session which finds nothing. If empty we create the NPE object and associate it to the user. When executing the same microflow we find multiple NPE objects, meaning the create DOES work but the retrieve DOES NOT work in the navigation microflow. The same applies to retrieving and associating the NPE object to the user. Any ideas? Mendix version 7.23.7