function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
wayohanwayohan 

Error: uncaught exception: API_CURRENTLY_DISABLED

Hi,

 

I am trying to create a apex page which creates a new Lead using the data input by a user. This is done through an ajax call which will not use any controller classes. My goal is to create a lead and redirect to another site. I have achieved this using the following code.

 

 

     var lead = new sforce.SObject("Lead");
     lead.lastName = "a";
     lead.company = "b";
     lead.status = "Open - Not Contacted";
     var result = sforce.connection.create([lead]);
     alert(result[0].id);
     window.location="http://www.google.com";

 

 

This works fine when executed in a page preview but throws an exception when the page is linked to salesforce sites.

Exception is follows.

 

Error: uncaught exception: {faultcode:'sf:API_CURRENTLY_DISABLED', faultstring:'API_CURRENTLY_DISABLED: API is disabled for this User', detail:{UnexpectedErrorFault:{exceptionCode:'API_CURRENTLY_DISABLED', exceptionMessage:'API is disabled for this User', }, }, }

 

Can anyone help me on this urgently?

 

Thanks

BharathwajBharathwaj

Wayohan,

 

First check the field level permissions for the fields that will be updated from the source.

We came across such error in integration with an external application. We rectified it by giving the correct field level permission for the user who will be pushing this data.

 

Thanks,

Bharath

wayohanwayohan

Bharath,

 

I checked on this but field level permissions are similar to system administrator permissions. I still couldn't find a way to solve this. Any hints??

 

Regards

SuperfellSuperfell

The Sites guest user doesn't have API access, which is what your clientside javascript is trying to use. Any reason why you don't want to create the record from the VF controller ?

wayohanwayohan

It is easy to use a VF Controller but our target is to find an alternative way of doing this without using a controller. Thats why I tried AJAX way. Any workarounds for this

 

Regards

bankimghelanibankimghelani

Create a new account as " Standard User" and if you're concerned about security whitelist the IP address for so the integration would work smoothly.