Page 2 of 3

Pass request parameter or any parameter with a service.execute({}) ?

Posted: Fri May 23, 2014 12:40 am
by RobertJay

I have a need for this and was hoping there's been some more recent information that I can better understand. For example, if I declare a custom service request parameter called "row_number" having a value of 5, how can I retrieve in the response when completed or when successful both the value I want as well as "row_number" = 5. Thanks.


Pass request parameter or any parameter with a service.execute({}) ?

Posted: Fri May 23, 2014 2:57 am
by Igor

Hello Robert,

You can get service response using service success event.
http://devcenter.appery.io/documentat...
or you can implement this, using JS. See this reply:
https://getsatisfaction.com/apperyio/...


Pass request parameter or any parameter with a service.execute({}) ?

Posted: Fri May 23, 2014 2:48 pm
by RobertJay

Igor, I'm sorry, but I can't find my answer there to what I presume is fairly routine: In some service-response event in some object there must be information on the request parameters for that service response. That's all I need. Thank you.


Pass request parameter or any parameter with a service.execute({}) ?

Posted: Fri May 23, 2014 6:45 pm
by RobertJay

Igor, I just found this code that you posted on https://getsatisfaction.com/apperyio/...

serviceName.execute({data: {"parameter1": "val", "parameter2": val},
success: function(){
//some code
}});

that may be exactly what I need. When I get back to the office I will test it and report back here.


Pass request parameter or any parameter with a service.execute({}) ?

Posted: Fri May 23, 2014 7:19 pm
by Kateryna Grynko

Hi Robert,

Thank you for the feedback, we'll wait for the update.


Pass request parameter or any parameter with a service.execute({}) ?

Posted: Fri May 23, 2014 10:07 pm
by RobertJay

Katya, I know I'm making great progress. The only problem I'm having is wrapping Igor's code in my own function, and passing in the parameter name and value. The issue is the double quotes. How do I make a call to my function like ...

bobfunc('param_name','param_value');

... so that the name and value have the required double quotes in Igor's code?


Pass request parameter or any parameter with a service.execute({}) ?

Posted: Fri May 23, 2014 10:43 pm
by RobertJay

Just to make sure I'm being clear:

call made like this (also with using various escape characters):
bobfunc ("latlng","28.33333,-80.4444")

bobfunc function(p1n,p1v){

// THIS WORKS: serviceName.execute({data: {"latlng": "28.33333,-80.4444"},
// THIS DOES NOT: serviceName.execute({data: {p1n: p1v},
success: function(){
//some code
}});
}


Pass request parameter or any parameter with a service.execute({}) ?

Posted: Sat May 24, 2014 4:03 am
by RobertJay

In thinking more about this, I think my needs can be met with my function simply executing the service using my UI's request mapping, but including a place for me to add custom code on success. This would then not require trying to pass to my function the request parameter name and value. To do this I would need a custom function like the following (which does not work). If you can provide the correct structure, that would be great:

function bobService(v){

serviceName.execute({},
success: function(){
//some code using my passed in variable v along with result of service
}});

}


Pass request parameter or any parameter with a service.execute({}) ?

Posted: Sat May 24, 2014 3:18 pm
by RobertJay

I've moved my issue to the thread https://getsatisfaction.com/apperyio/... to make it as simple as possible. Please consider my part of this thread closed. Thank you.


Pass request parameter or any parameter with a service.execute({}) ?

Posted: Fri Aug 07, 2015 12:29 am
by Estibens Manchego

$.each( data, function( key, alumcat ) {
console.log(alumcat.usuario_id);
alumno = alumnosListService.execute({
//parameters: [{name: "where", value: '{"categoria_id":'+alumcat.usuario_id+'}'}]
//parameters: [{"limit": "1500"}, {"where": "{'categoria_id':"+alumcat.usuario_id+"}"}]
parameters: [{name: "limit", value: "1500"}, {name: "where", value: "{'id':1111}"}]
});
console.log(alumno);
//$.each( alumno, function( key, value ) {
//console.log(value);
//});
});

not work