We have installed and tested servoy mobile on a server. With the demo "servoy_mobile", everything is OK.
But I tried to adapt this demo to our CRM database, and after decades of tries, impossible to connect to the application.
Instead of the"accountmanager" of the demo, we have an "entities" table to manage the multi-tenancy (with the field "entity_id").
Here's the code of the offline_data.js
- Code: Select all
*/
function ws_read(version,name)
{
var questionParams = arguments[arguments.length-1];
var retval = plugins.mobileservice.createOfflineDataDescription('data_');
//setting the key for user_select relation
var authenticate_info = questionParams.ws_authenticate[0];
globals.myEntityId = authenticate_info.entityid;
// //prepare personal data
var fs_entities = globals.myentityid_to_entities;//contains the account manager contact
traverse = new Array();
traverse.push('entites_to_companies');
traverse.push('companies_to_contacts');
retval.addFoundSet(fs_entities, traverse);
return retval;
}
function ws_authenticate(useruid,password)
{
if (useruid == null || useruid == 'admin')
{
useruid = 'admin'
}
if (password == 'a')
{
//TODO check password (against pwhash column)
// var retval = new Object();
// retval.username = useruid;
// return retval;
var retval = new Object();
retval.username = 'admin';
retval.id=4
retval.entityid=11
return retval;
}
return false;
}
We always have the message "Coudn't retrieve JSON" when we logged on the application. Have you an idea of where is the problem ?
Thank you very much.