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
Adam ColtonAdam Colton 

Address object for testing

I need an instance of an Address() for testing, but the constructor takes no arguments. What is the best way to handle this?
Tim BarsottiTim Barsotti

Adam,

Address is a compound field for Standard objects such as Accounts or Contacts. I would recommend you instantiate an Account or Contact with an address first, then you can utilize methods like getMailingAddress(). Here is the SOAP guide: https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/compound_fields_address.htm