1

I need to call apex rest service from salesforce mobile sdk-android. I can execute the soql query by calling RestRequest.getRequestForQuery() method. How to call apex service from RestRequest class?

1
  • I am stuck with the same thing. Here I am talking about Native code and not javascript
    – sud007
    May 8, 2020 at 13:38

1 Answer 1

1

Below code worked for me. I created an apex rest service and called the service from index.html using force.js

var fetchRecords = function (successHandler) {

    force.apexrest('/services/apexrest/MyRestService', successHandler, function(error) {
        alert('Failed to fetch data: ' + error);
    });
};

And this is how the function was called

fetchRecords(function(data) {
         console.log(data);

    })
}
1
  • I think OP has asked about the Native java/kotlin API from SDK to do so.
    – sud007
    May 8, 2020 at 14:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .