After the creation of the SQL action, paying attention to the datasource and to the parameters name needed for the call.
var vo_par =newObject()/* 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 =newSyncRequest().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);returnfalse; }}//the response will be a valueobjectif(risp.valueObjectList[0].GESTIONE_A_TEAM=='F') {...}
Where actionId=XXX is the ID of the SQL Action that must be executed and datastoreId=YYY is the ID of the additional datastore (omit to use the main Database)
If the SQL action is a SELECT the following method must be used: /executesql/executequery?appId=… while for all the other SQL operation (UPDATE, INSERT, DELETE) just use /executesql?appId=…