Mccourt.cordingley1372837951 wrote:Hi David
All the code is contained within the same solution, no module calls are made.
My code is declared in a scope of the same solution started as a headless client hence i am stumped.
If that's the case then, without testing I suspect that only global and form methods are available to headless client. These work for sure:
- Code: Select all
// Method on a form set with setMainForm(formName)
String results = (String)servoy_hc.executeMethod(null, "aMethod", new Object[]{session, request});
// Method on a form passed in
String results = (String)servoy_hc.executeMethod("formName", "aMethod", new Object[]{session, request});
// Global method
IDataSet results = (IDataSet)servoy_hc.executeMethod(null, "globals.aMethod", new Object[]{session, request});
Not sure about (and would be surprised if they did):
- Code: Select all
// Work?
IDataSet results = (IDataSet)servoy_hc.executeMethod(null, "scopes.scopeName.aMethod", new Object[]{session, request});
// Work?
IDataSet results = (IDataSet)servoy_hc.executeMethod(null, "globals.scopes.scopeName.aMethod", new Object[]{session, request});
For headless client work, we long ago started using forms to organize code available to the headless client. Kind of like a poor man's "public" API organization. If you get scopes to work though, that would be ideal.