Skip to main content
replaced http://salesforce.stackexchange.com/ with https://salesforce.stackexchange.com/
Source Link

If these fields are part of your managed package:

String[] Subfield = new String [] {'Name','eSyConnector_Endpoint__c','password__c','username__c','SSL_Certificate_Name__c','SetupOwnerId'};

then if you are using API 34.0 or laterAPI 34.0 or later you will need to include the namespace prefix of the fields in their names.

But if the set of fields is fixed and in your managed package, you can just write the code to use the SObjectField tokens directly and side-step this problem:

SObjectField[] fields = new SObjectField[] {
        SAPConfiguration__c.Name,
        SAPConfiguration__c.eSyConnector_Endpoint__c,
        ...
        };

 for (SObjectField f : fields) {
     if (!f.getDescribe().isCreateable()) {
         ...
     }
 }

If these fields are part of your managed package:

String[] Subfield = new String [] {'Name','eSyConnector_Endpoint__c','password__c','username__c','SSL_Certificate_Name__c','SetupOwnerId'};

then if you are using API 34.0 or later you will need to include the namespace prefix of the fields in their names.

But if the set of fields is fixed and in your managed package, you can just write the code to use the SObjectField tokens directly and side-step this problem:

SObjectField[] fields = new SObjectField[] {
        SAPConfiguration__c.Name,
        SAPConfiguration__c.eSyConnector_Endpoint__c,
        ...
        };

 for (SObjectField f : fields) {
     if (!f.getDescribe().isCreateable()) {
         ...
     }
 }

If these fields are part of your managed package:

String[] Subfield = new String [] {'Name','eSyConnector_Endpoint__c','password__c','username__c','SSL_Certificate_Name__c','SetupOwnerId'};

then if you are using API 34.0 or later you will need to include the namespace prefix of the fields in their names.

But if the set of fields is fixed and in your managed package, you can just write the code to use the SObjectField tokens directly and side-step this problem:

SObjectField[] fields = new SObjectField[] {
        SAPConfiguration__c.Name,
        SAPConfiguration__c.eSyConnector_Endpoint__c,
        ...
        };

 for (SObjectField f : fields) {
     if (!f.getDescribe().isCreateable()) {
         ...
     }
 }
Source Link
Keith C
  • 137.3k
  • 29
  • 218
  • 458

If these fields are part of your managed package:

String[] Subfield = new String [] {'Name','eSyConnector_Endpoint__c','password__c','username__c','SSL_Certificate_Name__c','SetupOwnerId'};

then if you are using API 34.0 or later you will need to include the namespace prefix of the fields in their names.

But if the set of fields is fixed and in your managed package, you can just write the code to use the SObjectField tokens directly and side-step this problem:

SObjectField[] fields = new SObjectField[] {
        SAPConfiguration__c.Name,
        SAPConfiguration__c.eSyConnector_Endpoint__c,
        ...
        };

 for (SObjectField f : fields) {
     if (!f.getDescribe().isCreateable()) {
         ...
     }
 }