application.closeSolution load a new solution with a method

Function closeSolution
Description Closes the currently open solution; can also include an argument to load (and open) a
specified solution when the currently active solution is closed.
Syntax
application.closeSolution([solution_to_load],[method],[argument]
)
Parameters
solution_to_load - the specified solution to load when the currently active
solution is closed; optional.
method - the specified method run from the currently active solution; optional.
argument - the argument for the specified method; optional.

application.closeSolution([solution_to_load],[method],[argument]
)

[method],[argument] are referred to the currently open solution (I can’t understand why, I can simply call a method before call the closeSolution)

My feauture request is to change this behaviour and open the method in the solution that I go to load as first argument.

Anyone interested?
Do you confirm this behavior?

As far as I know, the information is not right, the method and the arguments are for the new opened solution.

We use it that way, and it just works.

Did you already tried it?

Harjo how do you pass the method and arguments? The method must be global?

I use
application.closeSolution(‘mySolution’, ‘forms.myForm._dev_test’, ‘test’)

where forms.myForm._dev_test simply do a plugins.dialogs.showInfoDialog(‘’,arguments[0])

and the mySolution is loaded but no msgbox appear…

Hi axterics,

axterics:
application.closeSolution(‘mySolution’, ‘forms.myForm._dev_test’, ‘test’)

Method objects are usually passed without using quotes.
So your code should probably look like this:```
application.closeSolution(‘mySolution’, forms.myForm._dev_test, ‘test’)


Hope this helps.

Without quote:

The undefined value has no properties calling _dev_test.

Have you tried setting the form name into a variable first - seem to recall this worked for me in a similar situation:

var vFormName = 'forms.myForm._dev_test';

application.closeSolution('mySolution', vFormName,  'test')

Hmm…I can’t get any method to trigger using this function. String, variable, form method, global method or otherwise.
I tested this on Servoy Version 3.5.6-build 519, Java version 1.5.0_13-119 (Mac OS X) and Java version 10.0-b19 (Windows XP).

Harjo, do you use the method part of this function and if so does it work for you ?

I have build this in Servoy 3.1.6

application.closeSolution('myOtherSolution','GetCookie', 543671); //Attention: calling arguments only work in client!!

and it works! :-)

Your ‘GetCookie’ function is on the the “First Form” of the new loaded solution?

Can you test this on a 3.5.x version?

Can you call a function that simply do a plugins.dialog.showInfoDialog(‘’,arguments[0])
in either servoy version?

no, getCookie is a global method!

I can’t test this right now on 3.5, sorry…

SOLVED.
Works also in 3.5.x release.
The method (e.g. GetCookie) must be a global method in the new loaded solution.

application.closeSolution('myOtherSolution','GetCookie', 543671); 

ATTENTION
Don’t work in developer where the new solution appear but without calling any method whereas works perfectly on Servoy client.

If someone can move this thread in the section developer.methods I think can be useful for the future