+ Start a Discussion
notsosmartnotsosmart 

Apex reference to the address class associated to objects

I'm having a problem referencing the class fields (Street, City, etc) of address fields named something other than just address. Ie BillingAddress.  

 

When I use BillingAddress.Street it result in:

 

Didn't understand relationship 'BillingAddress' in field path.

 

Do you know what I'm missing here?  Thanks

Best Answer chosen by Admin (Salesforce Developers) 
sfdcfoxsfdcfox

Use the name directly (i.e. do not reference it as BillingAddress). The field names are:

 

BillingStreet
BillingCity
BillingState
BillingPostalCode
BillingCountry

ShippingStreet
ShippingCity
ShippingState
ShippingPostalCode
ShippingCountry

 

All Answers

sfdcfoxsfdcfox

Use the name directly (i.e. do not reference it as BillingAddress). The field names are:

 

BillingStreet
BillingCity
BillingState
BillingPostalCode
BillingCountry

ShippingStreet
ShippingCity
ShippingState
ShippingPostalCode
ShippingCountry

 

This was selected as the best answer
notsosmartnotsosmart
Thanks. So simple now.