calling a SQL action from a client side js action
var vo_par = new Object()
/* I'll use this variables in SQL with :COD_SOCIETA_FILTER, :COD_DIVISIONE_FILTER, :COD_ENTE, :ANNO */
vo_par['codSocietaFilter'] = vo['codSocieta'];
vo_par['codDivisioneFilter'] = ...;
vo_par['codEnte'] = ...;
vo_par['anno'] = ...;
var json = Ext.encode(vo_par);
/* EXECUTEQUERY is used just because the action contains a SELECT */
var url = contextPath +'/executesql/executequery?appId=' +applicationId+ '&applicationId=' + applicationId + '&actionId=2749&datastoreId=9';
/* Execute the call */
var response = new SyncRequest().send(url, 'POST', json, 'application/json');
/* Parse the response */
var parsed = JSON.parse(jsonrowsconfNegozio);
if (response != null && response != '') {
risp = Ext.decode(response);
if (risp['success'] == false) {
showMessageDialog("dialog.title.error", risp['message'], function() {}, false);
return false;
}
}
//the response will be a valueobject
if(risp.valueObjectList[0].GESTIONE_A_TEAM == 'F') {
...
}Last updated