Child pages
  • Server Side Scripting

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...


Info
titleModel changes to server

Beware that callServerSideApi does not send outstanding client side model changes to server; this should be handled by sending new values as parameters and modifying model server-side.

Internal API can also be used for API that is defined on client, but can only be called from server side scripting. This API shouldn't be called from Servoy Developer scripting and won't show in code completion.

Calling handlers from server-side js

Since Servoy 8.3 server side scripting also has access to the handlers a developer has assigned in the designer - through $scope.handlers. Together with the new "private": true configuration on a handler definition in the spec file, you can make handlers that are not directly callable from the client but only through server side scripting.

...

For information about documenting API functions see the documenting api functions example. For information about documenting model properties and handlers please have a look at Documenting what properties do / Documenting handlers and handler templates.

Calling special servoyApi functions from server-side js

Starting with Servoy 8.3.1, inside the server side scripting file of a component/service you can call specific Servoy provided functions using the "servoyApi" object.

...

Code Block
languagejs
titleservoy API example
var query = servoyApi.getQuerySelect(foundset.getDataSource());

Logging

Inside the server side scripting file of a component/service you can log messages using "console", not application,output. The output will appear in developer's console view as well as in the application server log file (depending on configured logging levels). For example:

...