+ Start a Discussion

describeSObjects error due to profile permission setting...how to check permission first?

Hi there, our code is describing a list of sobjects. The describe call is returning with the error: "INVALID_TYPE: sObject type 'MUSW__Permit__c' is not supported."


We know this is due to the profile not given any permissions on a particular object in the list. How do we check in the code to see if the user's profile has access to the objects first and then call describe on the list?


The situation is in an scontrol, but we need to learn how to do this in apex also. Our main concern is that describe calls are expensive in time, so we want to minimize the amount of describe calls to make.







If global describe does not cost too much for your application, then you can use it to get the map of only those objects which you have access to then can iterate through the map to limit the describe call for the objects you want.