Skip to main content
deleted 2 characters in body
Source Link
abdn
  • 535
  • 7
  • 21

I have a query like below in an Apex Class in Sandbox.

query = 'SELECT Id, Name, BillingAddress, BillingLatitude, BillingLongitude  FROM   Account WHERE Name = \''+ name +'\' AND ';
query += 'DISTANCE(BillingAddress, GEOLOCATION('+lat+', '+lng+'), \'km\') < '+distance+' ORDER BY DISTANCE(BillingAddress, GEOLOCATION('+lat+', '+lng+'), \'km\') ASC';

It works perfect in sandbox. But when I try to deploy this class to live, it generate this error:

System.QueryException: No such column 'BillingAddress' on entity 'Account'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

What are the possible reasons?

I have a query like below in an Apex Class in Sandbox.

query = 'SELECT Id, Name, BillingAddress, BillingLatitude, BillingLongitude  FROM   Account WHERE Name = \''+ name +'\' AND ';
query += 'DISTANCE(BillingAddress, GEOLOCATION('+lat+', '+lng+'), \'km\') < '+distance+' ORDER BY DISTANCE(BillingAddress, GEOLOCATION('+lat+', '+lng+'), \'km\') ASC';

It works perfect in sandbox. But when I try to deploy this class to live, it generate this error:

System.QueryException: No such column 'BillingAddress' on entity 'Account'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

What are the possible reasons?

I have a query like below in an Apex Class in Sandbox.

query = 'SELECT Id, Name, BillingAddress, BillingLatitude, BillingLongitude  FROM   Account WHERE Name = \''+ name +'\' AND ';
query += 'DISTANCE(BillingAddress, GEOLOCATION('+lat+', '+lng+'), \'km\') < '+distance+' ORDER BY DISTANCE(BillingAddress, GEOLOCATION('+lat+', '+lng+'), \'km\') ASC';

It works perfect in sandbox. But when I try to deploy this class to live, it generate this error:

System.QueryException: No such column 'BillingAddress' on entity 'Account'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

What are the possible reasons?

Tweeted twitter.com/#!/StackSalesforce/status/620179667358756864
reformatted code
Source Link
Jenny B
  • 10.6k
  • 3
  • 26
  • 51

I have a query like below in an Apex Class in Sandbox.

query = 'SELECT Id, Name, BillingAddress, BillingLatitude, BillingLongitude FROM Account WHERE Name = \''+ name +'\' AND '; query += 'DISTANCE(BillingAddress, GEOLOCATION('+lat+', '+lng+'), \'km\') < '+distance+' ORDER BY DISTANCE(BillingAddress, GEOLOCATION('+lat+', '+lng+'), \'km\') ASC';

query = 'SELECT Id, Name, BillingAddress, BillingLatitude, BillingLongitude  FROM   Account WHERE Name = \''+ name +'\' AND ';
query += 'DISTANCE(BillingAddress, GEOLOCATION('+lat+', '+lng+'), \'km\') < '+distance+' ORDER BY DISTANCE(BillingAddress, GEOLOCATION('+lat+', '+lng+'), \'km\') ASC';

It works perfect in sandbox. But when I try to deploy this class to live, it generate this error:

System.QueryException: No such column 'BillingAddress' on entity 'Account'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

What are the possible reasons?

I have a query like below in an Apex Class in Sandbox.

query = 'SELECT Id, Name, BillingAddress, BillingLatitude, BillingLongitude FROM Account WHERE Name = \''+ name +'\' AND '; query += 'DISTANCE(BillingAddress, GEOLOCATION('+lat+', '+lng+'), \'km\') < '+distance+' ORDER BY DISTANCE(BillingAddress, GEOLOCATION('+lat+', '+lng+'), \'km\') ASC';

It works perfect in sandbox. But when I try to deploy this class to live, it generate this error:

System.QueryException: No such column 'BillingAddress' on entity 'Account'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

What are the possible reasons?

I have a query like below in an Apex Class in Sandbox.

query = 'SELECT Id, Name, BillingAddress, BillingLatitude, BillingLongitude  FROM   Account WHERE Name = \''+ name +'\' AND ';
query += 'DISTANCE(BillingAddress, GEOLOCATION('+lat+', '+lng+'), \'km\') < '+distance+' ORDER BY DISTANCE(BillingAddress, GEOLOCATION('+lat+', '+lng+'), \'km\') ASC';

It works perfect in sandbox. But when I try to deploy this class to live, it generate this error:

System.QueryException: No such column 'BillingAddress' on entity 'Account'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

What are the possible reasons?

edited title
Source Link
abdn
  • 535
  • 7
  • 21

BillingAddress in Queryquery generate error

I have a query like below in an Apex Class in Sandbox.

query = 'SELECT Id, Name, BillingAddress, BillingLatitude, BillingLongitude FROM Account WHERE Name = \''+ name +'\' AND '; query += 'DISTANCE(BillingAddress, GEOLOCATION('+lat+', '+lng+'), \'km\') < '+distance+' ORDER BY DISTANCE(BillingAddress, GEOLOCATION('+lat+', '+lng+'), \'km\') ASC';

It works perfect in sandbox. But when I try to deploy this class to live, it generate this error:

System.QueryException: No such column 'BillingAddress' on entity 'Account'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

What are the possible reasons?

BillingAddress in Query generate error

I have a query like below in an Apex Class in Sandbox.

query = 'SELECT Id, Name, BillingAddress, BillingLatitude, BillingLongitude FROM Account WHERE Name = \''+ name +'\' AND '; query += 'DISTANCE(BillingAddress, GEOLOCATION('+lat+', '+lng+'), \'km\') < '+distance+' ORDER BY DISTANCE(BillingAddress, GEOLOCATION('+lat+', '+lng+'), \'km\') ASC';

It works perfect in sandbox. But when I try to deploy this class to live it generate this error:

System.QueryException: No such column 'BillingAddress' on entity 'Account'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

What are the possible reasons?

BillingAddress in query generate error

I have a query like below in an Apex Class in Sandbox.

query = 'SELECT Id, Name, BillingAddress, BillingLatitude, BillingLongitude FROM Account WHERE Name = \''+ name +'\' AND '; query += 'DISTANCE(BillingAddress, GEOLOCATION('+lat+', '+lng+'), \'km\') < '+distance+' ORDER BY DISTANCE(BillingAddress, GEOLOCATION('+lat+', '+lng+'), \'km\') ASC';

It works perfect in sandbox. But when I try to deploy this class to live, it generate this error:

System.QueryException: No such column 'BillingAddress' on entity 'Account'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

What are the possible reasons?

Source Link
abdn
  • 535
  • 7
  • 21
Loading