3

I am facing the error

{faultcode:'sf:INVALID_TYPE', faultstring:'INVALID_TYPE: sObject type 'SetupEntityAccess' is not supported.', detail:{InvalidSObjectFault:{exceptionCode:'INVALID_TYPE', exceptionMessage:'sObject type 'SetupEntityAccess' is not supported.', row:'-1', column:'-1', }, }, }

on clicking a custom button

Java Script code on Button Click

    {!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}
    {!REQUIRESCRIPT("/soap/ajax/29.0/apex.js")}

    var result = sforce.connection.query("SELECT Id, Parent.Name, 
          Parent.Profile.Name, Parent.Profile.Id FROM SetupEntityAccess 
          WHERE Parent.Profile.Id = '{!$Profile.Id}' AND SetupEntityId 
          in (SELECT Id FROM ApexPage WHERE Name = 'myPage' AND 
          NamespacePrefix = null)"); 

    if(result.records){ 
        alert('yes :) '); 
    } 
    else{ 
        alert('no :( '); 
    }
1
  • 3
    I've tried your code and it works for me. What is the profile of the user who gets this error? Maybe he doesn't have the proper permissions to read the SetupEntityAccess object? Jul 21, 2015 at 13:12

1 Answer 1

1

Got answer !!!

That looks to be a permissions issue. The user making the request needs to have the View Setup and Configuration permission.

You must log in to answer this question.

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