heroku & salesforce
[Salesforce APEX] 쿼리에서 BillingAddress 에러_ No such column
배추잠자리
2022. 4. 29. 00:01
반응형
# BillingAddress in query generate error
■ ERROR CODE
System.QueryException: No such column 'BillingAddress' on entity 'Account'.
분명 Account 객체에는 BillingAddress 컬럼이 있으나 막상 쿼리에서 사용하려고 하면 존재하지 않는다는 에러를 뱉는다.
원인은 BillingAddress가 복합필드이기 때문이다.
■ 잘못된 query
List<Account> account_list = [select Id, Latitude__c, Longitude__c, BillingAddress from Account];
■ 올바른 query
List<Account> account_list = [select Id, Latitude__c, Longitude__c, BillingState, BillingCity, BillingStreet from Account];
BillingState, BillingCity, BillingStreet 컬럼을 활용하면 된다.
반응형