0

I have a managed base package and an extension package. The base package had a remote site as one of the components but I had to remove it. Since I couldn't remove the remote site from a released managed package, I signed up for a new dev edition and migrated the other components. I signed up for another dev edition, installed the new released base pkg in it, and migrated the old extension package components to it. I uploaded this new extension package and tested in a full sandbox with both unmanaged and managed-beta versions of it. The unmanaged version works fine but when I'm trying to install the managed-beta version, it is failing.

The full sandbox has a custom object X and a custom field Y in X. The extension package has a dynamic SOQL query "Select Y__c from X__c". The installation is failing with the error "No such column Y__c on X__c. I have System Admin profile and moreover the field accessibility of Y__c is "Editable" for all profiles in that sandbox. None of the apex classes in these packages have "with sharing" and the API names in the SOQL queries are correct. The managed version of the old extension package used to work completely fine in this same sandbox and no changes have been made to the SOQL queries in the new extension package.

Later, I changed the query to "Select Name from X__c" and it didn't throw any error but another similar query in the package(to get a custom field B__c from custom object A__c) threw the error saying "No such column B__c on entity A__c". Then I replaced "Select Y__c from X__c" with "Select ProductCode from Prodyuct2" and tried to install the package again. This query worked fine (but the other similar query failed) then.

I'm worried because I need to fix this asap but I don't have a clue why this is hapening. I really appreciate if anyone could help me here.

Thanks in advance!

1
  • FYI, the object and field API names are dynamic, hence retrieved using Schema.getGlobalDescribe(), Schema.SObjectType, Schema.SObjectField...
    – user12106
    Jun 15, 2015 at 22:37

1 Answer 1

0

If you are using dynamic SOQL you have to append the namespace before the fields and objects. Try something like this:

SELECT mynamespace__Y__c FROM mynamespace__X__c

You must log in to answer this question.

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