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
Synthia B.Synthia B. 

Web service callout failed: WebService returned a SOAP Fault: INSUFFICIENT_ACCESS

Users are getting the message below. How can I fix this issue? 

Web service callout failed: WebService returned a SOAP Fault: INSUFFICIENT_ACCESS: use of the Metadata API
requires a user with the ModifyAllData permission faultcode=sf:INSUFFICIENT_ACCESS faultactor=
Error is in expression '{!insertSTC}' in component <apex:commandButton> in page servicetaskscreate:
Class.MetadataService.MetadataPort.readMetadata: line 69, column 1
Class.ServiceTasksCreateController.PicklistField: line 290, column 1
Class.ServiceTasksCreateController.insertSTC: line 226, column 1
An unexpected error has occurred. Your development organization has been notified.
Best Answer chosen by Synthia B.
Neetu_BansalNeetu_Bansal
Hi Synthia,

I guess you are doing something with Metadata on a object, in this case, your user should be having 'ModifyAllData' permissions on that object.

Let me know iy are able to resolve this issue.

Thanks,
Neetu

All Answers

David ZhuDavid Zhu
Is "API enabled" permission enabled in user Profile?
Synthia B.Synthia B.
Hi David, 

API is eanble fore the user Profile. 
Neetu_BansalNeetu_Bansal
Hi Synthia,

I guess you are doing something with Metadata on a object, in this case, your user should be having 'ModifyAllData' permissions on that object.

Let me know iy are able to resolve this issue.

Thanks,
Neetu
This was selected as the best answer
Synthia B.Synthia B.
Hi Neetu, 

The error is coming from a VF page. How would I enable "ModifyAllData" for the VF page? 

Thanks!
Mohammad AnzarMohammad Anzar
Hi,
I am facing the same error. What can I do to resolve this issue. I have given permission the object still getting this error.