Expand my Community achievements bar.

Javascript Alerts for Server Side Execution

Avatar

Level 2

I am on AEM 6.1

I have a form that has Javascript that runs at the client, at the server, and at Client and server.

For the javascript that runs client side, I can use console.log or xfa.host.messageBox to display a message either in the console or browser to aid me along in debugging issues.

However, I cannot seem to find a way to print either a message to server logs, or somewhere else to help with debugging.  If I use console.log or xfa.host.messageBox on the JS that is running on the server, it seems to cause the script not to run, or fail.

I have client run JS that initiates another set of JS on the server, which in turn initiates more JS on the server in another part of the form.  Somewhere in the server side processes, I have an issue.

I have a WSDL call that is run, but it currently only allows me to run it based off one filepath.  If I change the WSDL path to another version of the process (a valid working version), it fails.  I cannot troubleshoot if it is failing to either call the WSDL, or if it's failing after calling it and returning a wrong result.  I need some way to be able to see when something is executing server side, for it to let me know where in the execution it is, to let me know what values the variables are holding, so I can figure out what's different when I change the WSDL path.

How can I print messages to some location for JS executed on the server side of the transaction?

12 Replies