Search code examples
palm-prepalmmojo

Mojo SDK retrieve all contacts


I'm playing with the Mojo SDK and I want to get all contacts.

this.controller.serviceRequest('palm://com.palm.contacts/crud', {
     method:   'listContacts',
     parameters: {
       limit: 100
     },
     onSuccess: this.handleListResponse.bind(this),
     onFailure: function(errResp){
       Mojo.Log.info(errResp.errorText)
     }.bind(this),
     onerror: function(errResp){
       Mojo.Log.info(errResp.errorText)
     }.bind(this)
});

This is what I have right now, but I don't get anything back. And Mojo.Log.info doesn't seem to work. Any suggestions?

Thanks


Solution

  • I'm also fairly new at PRE development but here is what I think the issue is.

    The error that comes back is "Account Not Found". You need to add accountId: as a parameter to the service request.

    That account id, according to the documentation, is a Synergy account and needs to be created for your application. Click here for reference about the accountId and createAccount methods