I have to check the application.getMethodTriggerFormName() but in same case it’s equal to null,and the server reports the error into the log :
2009-03-24 17:18 AWT-EventQueue-0 ERROR com.servoy.j2db.util.Debug Shouldn’t happen that the trigger element names are empty, is this called in a script that is triggered by solution startup?
why this function work in this way?
the code is :
if (application.getMethodTriggerFormName() != null){
}else{
}
during the evaluation of the IF condition the error was throwing.
As far as I know this should/can not happen.
When is the method called and how is it called (event, other method etc, when from another method, where is that one called from etc…)
The fix Nicola said is for a global method who is called from Smart client menu. In 3.5, application.getMethodTriggerFormName returned the current form name and in 4.1 returned null. Your situation is different, you execute the method on click in tree. Here, if context is null (global) application.getMethodTriggerFormName will return null and if context is the form’s name will return that. I don’t think we would/can change that because we don’t have access to current form from plugin. You can send a state argument to the method to differentiate between different calls in this case.