SAP Builders Discussions
Join the discussion -- ask questions and discuss how you and fellow SAP Builders are using SAP Build, SAP Build Apps, SAP Build Process Automation, and SAP Build Work Zone.
cancel
Showing results for 
Search instead for 
Did you mean: 

Every single time I try to use Java it wont work

StacksIndeed
Explorer
0 Kudos
270

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

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos
193

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

srose99
Explorer
0 Kudos
172

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.

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos
156

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