Defining Asynchronous JavaScript Code

Defining Asynchronous JavaScript Code

  

I'm trying to create simple mobile app with asynchronous javaScript code, using this page as guide.

App setup

  • Screen with a button to call client action a
  • client action a with the following javascript
    • $actions.b().then(function(result){
          console.log(result);
          $resolve();
      });
  • client action with the following javascript
    • $parameters.teste = 1;
      $resolve();

With this setup I'm getting a log of undefined, but I think the example is pretty similar to the one described in the page linked above. Am I missing something?


Cumpz,

Vitor


Have you define a output variable in the client action b?

Solution

Hi Vitor,

is your b action a screen action or a client action?

If it is the 1st case, have you tried creating your b action in the logic tab in Service Studio and setting the output in a return variable?

Solution

Not really... as it wasn't explained on the documentation.

Constantino Gomes wrote:

Have you define a output variable in the client action b?



It works!!!

João Heleno wrote:

Hi Vitor,

is your b action a screen action or a client action?

If it is the 1st case, have you tried creating your b action in the logic tab in Service Studio and setting the output in a return variable?



@Vitor

Could you share your working OML? It could help me as a good and simple example

Greetings,
Niels