0

I am facing problem when create managed package on my developer account. i am using custom fields in my application when I create a managed package it need to give namespace prefix (dks) it's fine. suppose I used an dynamic query like

select id, customer__c, Address__c from account

But problem is that my custom field see like

dks__customer__c, dks__Address__c

Due to this reason my query going wrong. How can we ignore this issue. Any other way can we create manage package without namespace.

2
  • 1
    I think the only solution is update your all dynamic query with namespace.
    – Ratan Paul
    Dec 10, 2015 at 11:36
  • Thanks, Ratan.. Any other way can we protect because it may trouble to change code..
    – Dilip
    Dec 10, 2015 at 11:56

1 Answer 1

1

Are you running your queries in Apex or javascript?

As far as I recall, SOQL in an apex controller, in a managed package, is namespace aware of its own package siblings.

To clarify:

If I package Customer__c field and getCustomer.class

And getCustomer.class contains [SELECT Customer__c FROM Account]

Then this query will magically become [SELECT dks__Customer__c FROM Account] when packaged.

If you are running SOQL in Apex against objects contained in a managed package, then you naturally have to provide the correct namespace.

If you write (and package) js, in a vf page for example, then you will somehow need to determine the namespace. This might help.

1
  • 1
    Thanks, I am using SOQL query on apex page but dynamic like string str='SELECT dks__Customer__c FROM Account';. This is the wrong it should be mentioned by Salesforce in doc with highlight.... Any way thanks again..
    – Dilip
    Dec 10, 2015 at 14:44

You must log in to answer this question.

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