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
naresh reddy 18naresh reddy 18 

Schema.SObjectType.CnP_PaaS__Contact_Mail_ids__c.fields.getMap() is empty

HI Friends,

    My managed package was installed in a customer instance. In that perticular instance only I have this problem.
Map <String, Schema.SObjectField> customfieldMap = Schema.SObjectType.CnP_PaaS__Contact_Mail_ids__c.fields.getMap();

    Problem is, customfieldMap is empty. My package is used by many cusotmers every where its working fine but  only in this instance we have this problem.

    Can any one please let me know the reason for customfieldMap empty?

Thanks in advance,
Naresh
Best Answer chosen by naresh reddy 18
naresh reddy 18naresh reddy 18
HI,

  I solved the problem. Pls open the your managed package detail page in "Installed Packages" menu. The check the API Access option. That should be unrestricted. Now my code is working fine and  
Map <String, Schema.SObjectField> customfieldMap = Schema.SObjectType.CnP_PaaS__Contact_Mail_ids__c.fields.getMap();

This map is with right values now.

Thanks,
​Naresh