Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Every single time I try to use Java it wont work

StacksIndeed
Explorer
0 Likes
1,089

I cant find anywhere in the tutorials where it shows you how to use the formulas or Java. I just want to be able to use some of my Java script but it never works. I cannot even use the Java node to make a simple log.console message.

3 REPLIES 3
Read only

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Likes
1,012

Is this a real post? If it is, can you explain what you are talking about -- what tool, what error you get, screenshot?




--------------
See all my blogs and connect with me on Twitter / LinkedIn
Read only

srose99
Explorer
0 Likes
991

Check this link for formulas: https://help.sap.com/docs/build-apps/service-guide/formula-functions

For Java example create a button and  go into the logic section for the button. Drag over the Javascript node at the bottom and hook up the component tap to the node. Double click the node and replace the sample code in there with console.log('Hello world');

Run it using the preview on the web, open the console log in the browser and tap the button.

Read only

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Likes
975

It's console.log().

I created a test app, with button that runs a JavaScript flow function.

Dan_Wroblewski_1-1725361368405.png

The JavaScript includes console.log output, plus it returns some info based on the input.

Dan_Wroblewski_3-1725361457982.png

When you run it and click the button, the console message can be seen.

Dan_Wroblewski_0-1725361296512.png

The console message will be displayed even if the JavaScript crashes, as in this case, where I did not do anything but print out a console message and did not provide the output. 

Dan_Wroblewski_4-1725361599193.png

HTH

 




--------------
See all my blogs and connect with me on Twitter / LinkedIn