You need to sign in to do that
Don't have an account?
songlan
batch in post install script cause a First error: Attempt to de-reference a null object error
Hello all,
I installed in my developer org a package with a batch in the post install script. After installation, the batch is executed with Status Detail:First error: Attempt to de-reference a null object. But when I execute the batch manuelly (with execute anonymous) it works. I turned on the debug log before installation but don't see anything in the log and the Notify on Apex Error is set but no mail received.
Anyone have some ideas of what happened or how I can get some log for the post install script?
Thanks in advance.
I figured it out. In the post install script I called a method from a "with sharing" class, which the "post install script executor" doesn't have access I suppose. I removed the "with sharing" and it works.
All Answers
I find this http://www.tgerm.com/2010/09/batch-apex-de-reference-null-object.html
But in my case, the query is Select Id From Account Where... and can't be null
yes in the batch I read some contact and account fields and generate attachments.
I figured it out. In the post install script I called a method from a "with sharing" class, which the "post install script executor" doesn't have access I suppose. I removed the "with sharing" and it works.