How can I get value in runjavascript of server action?

How can I get value in runjavascript of server action?

  

I want to get a value computed from server action,runjavascript.And I want to assign this value to a local variable.

Web app.

No screen involved,so I cannot pass the value via hidden element.

Solution

Hello Alex,

There is something wrong here.

RunJavaScript do not RUN a JavaScript. It only send the JavaScript to the Browser. Is the Browser that runs the JavaScript, in a screen... Server does not have (by default), a JavaScript interpreter.

If you need to compute something server side, use OutSystems logic to do it.

Cheers.

Solution

Eduardo Jauch wrote:

Hello Alex,

There is something wrong here.

RunJavaScript do not RUN a JavaScript. It only send the JavaScript to the Browser. Is the Browser that runs the JavaScript, in a screen... Server does not have (by default), a JavaScript interpreter.

If you need to compute something server side, use OutSystems logic to do it.

Cheers.


Thanks for your reply,it really helps me understand well.

In fact, I calculate a value via certain js lib. So I have to run js in server.

Is there any solution for this?

Regards,

Alex 

Hi Alex,

"Out of the box"? None that I know.
You can take a look into Forge to see if there is something there, or something that does the same thing you need.

And if you have access to any other server capable to run JavaScript code (Node.js?), maybe you can create a web service to this, for example, but I think it would be overkill.

You would be better (probably) trying to find an alternative in OutSystems, or in DotNet/Java (depending on your stack) that you can create an extension to use directly in OutSystems.

Cheers.

Eduardo Jauch wrote:

Hi Alex,

"Out of the box"? None that I know.
You can take a look into Forge to see if there is something there, or something that does the same thing you need.

And if you have access to any other server capable to run JavaScript code (Node.js?), maybe you can create a web service to this, for example, but I think it would be overkill.

You would be better (probably) trying to find an alternative in OutSystems, or in DotNet/Java (depending on your stack) that you can create an extension to use directly in OutSystems.

Cheers.

Thank you again.

I'm now trying Java solution.