RobertJay
Posts: 0
Joined: Fri Jun 15, 2012 1:32 pm

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

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.

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

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

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/...

RobertJay
Posts: 0
Joined: Fri Jun 15, 2012 1:32 pm

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

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.

RobertJay
Posts: 0
Joined: Fri Jun 15, 2012 1:32 pm

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

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.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

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

Hi Robert,

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

RobertJay
Posts: 0
Joined: Fri Jun 15, 2012 1:32 pm

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

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?

RobertJay
Posts: 0
Joined: Fri Jun 15, 2012 1:32 pm

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

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
}});
}

RobertJay
Posts: 0
Joined: Fri Jun 15, 2012 1:32 pm

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

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
}});

}

RobertJay
Posts: 0
Joined: Fri Jun 15, 2012 1:32 pm

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

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.

Estibens Manchego
Posts: 0
Joined: Thu Sep 18, 2014 9:38 pm

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

$.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

Return to “Issues”