You need to sign in to do that
Don't have an account?
Apex Batch jobs fail after adding namespace without sending notifications - with resolution
Just wanted to share this as it caused us a lot of headaches.
We have a batch jobs set up that has the following QueryLocator definition:
global Database.QueryLocator start(Database.batchableContext bc)
{
string sQuery = 'SELECT ID,Name,CustomField__c, CustomField2__c FROM MyCustomObj__c';
return Database.getQueryLocator(sQuery);
}
This began failing immediately on us without sending any notification emails about the failures once we added a namespace. Having no debugging info, this took us a long time to sort out.
In the end, we needed to add our new namespace to each field we were querying, like the following:
global Database.QueryLocator start(Database.batchableContext bc)
{
string sQuery = 'SELECT ID,Name,MyNamespace__CustomField__c, MyNamespace__CustomField2__c FROM MyNamespace__MyCustomObj__c';
return Database.getQueryLocator(sQuery);
}
And then it worked!
My batch APEX is also failing.
It fails in Production, but works in the Sandbox. I cannot figure out why.
How do you figure out what your namespace is?