Hi everyone,
We are reaching out for guidance on a namespace conflict issue we are facing in our SharinPix managed package.
In our managed package, we have a custom object named Job__c. One of our customer orgs also has an unmanaged custom object with the same API name: Job__c.
In Apex, we derive the object name from the customer’s record Id:
recordId.getSObjectType().getDescribe().getName()
This returns Job__c, and the record Id belongs to the customer’s unmanaged object.
However, when we execute dynamic SOQL from within our managed package, FROM Job__c resolves to the SharinPix managed package object. We understand this is the default Salesforce namespace resolution behavior in a managed package context.
Has anyone found a reliable workaround for this? Is there any supported way to explicitly query the subscriber/default-namespace object from managed package Apex when both objects have the same API name?
Thanks a lot
cc:
@Kevan Moothien
#AppExchange
This has been on Salesforce' plate for sometime now. Unfortunately nothing has moved forward.
https://ideas.salesforce.com/s/idea/a0B8W00000Gdh9rUAB/support-dynamic-soql-no-shadowing-option .