application.closeSolution

Hello,

How to use
application.closeSolution([solutionToLoad],[method],[argument])
on clean way?

Currently with
application.closeSolution(“TestSolution”)
it mixes up foundset that contains tenants, for example.
Do I need to terminate session or sg further? How to improve?

So I need new session like if I’d close and then re-start again the Smart/Web client from Developer

Regards

What exactly is mixed up?

Paul

In properties of my solution firstForm is frm_main_menu, loginForm is frm_login.

workflow:
-login to solution via the frm_login;
-clicked on button that invokes action which last line of code is

application.closeSolution("TestSolution")

-frm_login doesn’t appear but goes directly to the frm_main_menu. This causes that tenants are not loaded properly on restart, in my case .

How to restart the solution completely? So to go back to frm_login again? That will solve the problem, I think.
Do I need to unload all forms explicitly? How?

I’ve also tried to

application.closeSolution("TestSolution", "firstMethodName")

but doesn’t work as Servoy’s order not seem to be correct anymore

How to reach clean re-start (point on elegant way)?

Regards

When doing this through application.closeSolution(), the user remains logged in if he is logged in.

I think what you’re looking for is security.logout(‘solution_name’,‘global_method_name’,‘my_argument’);

Paul

this is the one, we use:

	security.logout()
	application.closeSolution('TestSolution')

if you use logout then the solution will be closed if the user was logged in (and the solution requires authentication)

so in harjo’s example this should be only needed:

security.logout(‘TestSolution’)

Great tip! Thanks, Johan! Might be a good idea to add this to the documentation Wiki…

i think it pretty logical especially when the solution requires authentication…
Because what else can we do? If the solution requires authentication then closeSolution is the only solution when you logout.

The only thing is if the solution doesn’t require authentication what should we do then? Just also always close it? To be consistent?
I also don’t think that this will not happen a lot. If you use security/login then i guess the solution is configured to use it.