Access session ID in after startup microflow

0
Hi,  I created an after startup microflow and would like to create an entity which is mapped to the currentSession. The entity has an association to the currentSession. My issue is now that in the after startup microflow the session ID is undefined and I cant create this association. Seems like the session and also current User is not available at this time. Can anyone help here? As the configuration is called “After startup” I assumed that the session and user is already created so that I can access it.       
asked
3 answers
0

The similar question was asked earlier https://forum.mendix.com/link/questions/109984

The solution proposed by Tim there would work for you:

in StudioPro in your project explorer go to Navigation Select a microflow instead of a page, as Home page. In the microflow, you can access the session id and also after this show whatever page you would like to show.

answered
0

Hi Anna,

After-Startup microflows are run as part of the loading process for a Mendix application. This occurs before there are any users using the application, hence the current user and session not being available.

https://docs.mendix.com/refguide/project-settings#after-startup

Hope this helps.

answered
0

Hi Anna,

you can create a custom rolebased homepage in the navigation, set it to microflow, in which the session id is available and you check if the object is associated and if not create it. 

If you don't like this, you can create a custom login handler in which you create this object after successfully logging in to the application.

answered