function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jakson MonteiroJakson Monteiro 

How can we access the BillingAddress or Shipping address in Account ?

I m writiing a trigger to check the Billing address and Shipping address if the billing address is given and shipping address is not given than it matches shipping address with billing address.

I am not able to get access to Billingaddress or shipping address in account.

Throws a error:Compile Error: Data type not supported: Address at line 6 column 9

trigger AccountAddressTrigger on Account (after insert,after update)
 {
 
 for(Account a:Trigger.new)
 {
     if(a.BillingAddress!='')
     {
     
     }
     
          }
 
}
Best Answer chosen by Jakson Monteiro
Balaji Chowdary GarapatiBalaji Chowdary Garapati
@Jakson Monteiro:

Billing Address & Shipping Address are compound fields, You need to refer each field like BillingStreet,BillingCity,BillingState,BillingPostalCode,ShippingStreet,ShippingCity ...  in trigger and write your logic around these fields.


Below link will explain more considerations of compound fields.

https://www.salesforce.com/developer/docs/api/Content/compound_fields_limitations.htm


Thanks,
Balaji

All Answers

Balaji Chowdary GarapatiBalaji Chowdary Garapati
@Jakson Monteiro:

Billing Address & Shipping Address are compound fields, You need to refer each field like BillingStreet,BillingCity,BillingState,BillingPostalCode,ShippingStreet,ShippingCity ...  in trigger and write your logic around these fields.


Below link will explain more considerations of compound fields.

https://www.salesforce.com/developer/docs/api/Content/compound_fields_limitations.htm


Thanks,
Balaji
This was selected as the best answer
Stephen MaderStephen Mader
Hello, 

I think the link you reference has changed. I believe the new link to "Compound Field Considerations and Limitations" can be found here:
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/compound_fields_limitations.htm