+ Start a Discussion
Rajeev GuptaRajeev Gupta 

Schema.SObjectType.Contact.fields.getMap() and Managed Package

We are suddenly facing a new problem in our code this week.

Schema.SObjectType.Contact.fields.getMap() was returning values when the code is unmanaged state - but when we move this class into a Managed package we are find that it return an empty value.

We saw this first time over the weekend - did anything change with the upgrade this week - any change in API etc...

Any assistance or insight would be appreciated.

Thanks
RG

gregsgregs
i had the same issue happen to me.  basically once your packaged is managed, it cannot access describe info for objects outside of the package namespace unless you explcitly set those permissions.  to do that, go to your package page and click on the link near the top right that says "API Access".  If it says "Untresricted (Your package contains scontrols" then unfortunately this is a issue salesforce does not have a solution for at this time, unless you remove scontrols from your package and try to repackage them in another package, mamanged or otherwise.  If your packages does NOT contain scontrols, tnen you can select the objects here that you need api access to through apex.