Asif
Posts: 0
Joined: Tue Aug 13, 2013 12:56 pm

how to write success event of a database service using javascript

I have a call a create service on the success of a query service, but I have to achieve this scenario using java script.

pls help!!

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

how to write success event of a database service using javascript

Hi -

Can you show the code you have tried?

For events handling please check this section:
:: http://docs.appery.io/documentation/r...

Asif
Posts: 0
Joined: Tue Aug 13, 2013 12:56 pm

how to write success event of a database service using javascript

I will tell you the scenario :

I am mapping response of a service "$" to a java script.
In this java script i m calling a database inquiry service. And on the success of the inquiry service i have to call another create service.
Parameters of the create service will come from the $ which i have marked to JS.
So how can i write a success event of inquiry service in this JS where i can call the create service.

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

how to write success event of a database service using javascript

Hi Asif.

You need to "Add js" to your js in the mapping. http://docs.appery.io/documentation/r...

By means of this you can:

  1. Access your "$" through the "value" variable.
    pre

    var user_name = value.userName;/pre

  2. Invoke the service:

    preserviceName.execute({data: {"parameter1": "val", "parameter2": val} });/pre

Asif
Posts: 0
Joined: Tue Aug 13, 2013 12:56 pm

how to write success event of a database service using javascript

Hi Alena,
These 2 steps i m already doing, what i want is that after invoking the service i want to write success event of this service in the same js.

like step 1
code
serviceName.execute({data: {"parameter1": "val", "parameter2": val} });
/code
step 2
code
serviceName.onSuccess();
//my code
/code

something like this

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

how to write success event of a database service using javascript

Hi,

Using service event on the service data tab is more preferable

http://docs.appery.io/documentation/r...

or you could use code below:
pre
code
serviceName.execute({data: {"parameter1": "val", "parameter2": val},
success: function(){
//some code
}});
/code
/pre

Asif
Posts: 0
Joined: Tue Aug 13, 2013 12:56 pm

how to write success event of a database service using javascript

Hi Igor.
Thanks a lot, this is exactly what i want.

Enfiled Riders
Posts: 0
Joined: Fri Jun 05, 2015 6:07 am

how to write success event of a database service using javascript

How do I write an update service in java?..this update service has a where clause and a $set clause.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

how to write success event of a database service using javascript

Hi -

Appery.io don't work with Java, every database service is a REST service you will need just to invoke it this way: https://devcenter.appery.io/documenta...

Database API is explained here: https://devcenter.appery.io/documenta...

Return to “Issues”