So I am trying to deploy a changeset and in one of the tests I am referencing the PersonMailingAddress with the following query:

[Select Id, PersonMailingAddress From Account Where Name Like '%Test%'];

The deployment fails saying there is no such field on account.

So I modified the code (not like this but to represent)

     ....Do Query Here....
}catch(Exception e){

Now it deploys and during deployment the error message is output to the debug log.

The weird part is that when I run the test after deployment I DO NOT get an error message and the test never enters the catch block...

I added the catch solely to be able to deploy.

Any insight on why that field is not found on the account sObject during deploy only but is present before and after via query, code, and as proven by the test method ran after deploy not throwing an error? Same user is deploying in all cases.

Just in case it could be part of the issue, code is being deployed when logged into client org via the LMA.

Again to clarify, Only during deployment does the system throw an error that PersonMailingAddress is not found on the Account sObject. The exact same test passes fine after deployment. No changes are made to the profile, permissions, fields etc during deployment. In fact, to validate no permissions were altered, after the successful deployment, a subsequent deployment of the code with the try catch removed still throws the error.

Curious to know if anyone has ran into this before?

1 Answer 1


Change the API version of your class / Trigger to 30.0 or later version.

  • If that was the problem (and its not cause it is at 39) then it would not pass after deploy....
    – Eric
    Commented Mar 14, 2017 at 16:06
  • Please go through with the similar kind of known issue.success.salesforce.com/issues_view?id=a1p30000000T3FOAA0
    – R.Malla
    Commented Mar 14, 2017 at 16:08
  • I am down voting as you seem to be missing the point that the tests run without issue and the PersonMailingAddress does not cause an issue at all after deployment without any modifications. If it was a version issue it would fail on deploy and fail after deployment
    – Eric
    Commented Mar 14, 2017 at 16:09
  • never mind!!! . This will help for someone.
    – R.Malla
    Commented Mar 20, 2017 at 16:14

You must log in to answer this question.

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