Remote Call increases the API Request Count Limit

  • 1
  • Question
  • Updated 2 years ago
  • Answered
  • (Edited)
The ways in which one can invoke Apex from script( https://community.skuid.com/skuid/topics/calling_apex_function)  increase the API request count(except if you use  skuid:page and include your skuid page in a visualforce page). 

Why is the following way for apex remoting not supported?

namespace.ControllerName.MethodName([Parameters],        
function(result, event){
             //In this callback function the response is handled in asyn.
});

Because eventually what we see is a Visualforce page as the url(<domain>/apex/skuid_ui?params) has '/apex/'.
Photo of Sneha

Sneha

  • 624 Points 500 badge 2x thumb

Posted 2 years ago

  • 1
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,004 Points 20k badge 2x thumb
First of all, the title of your question is inaccurate --- Visualforce Remoting requests do NOT consume Salesforce API calls. 

As far as the second part of your question, the reason that you cannot call a generic Apex controller method from Skuid's UI visualforce page (accessed through /apex/skuid__ui) is that Apex doesn't support dynamic method invocation except through their "Invocable Method" annotation --- but if invoke an invocable method, they charge you an API request.

The only way that additional JavaScript Remoting Apex methods can be exposed to Skuid in Visualforce in the format you're asking about (namespace.ControllerName.MethodName() etc...) is to create a separate Visualforce Page and specify your own Apex controllers on it. Skuid's UI Visualforce Page is in a managed package and so it's impossible for us to add in additional customer controllers to it, that's why we offer you the approach of creating a separate Visualforce Page and then using the <skuid:page> component --- this way you can add in whatever controllers you want and be able to call them from that page.