dw.customer
Class AddressBook

Represents a set of addresses associated with a specific customer.
The AddressBook object gets its data from the Profile object for the customer.
When scripting, this class allows AddressBook to be treated as a separate object
from the Profile. However, data is only stored in the platform in the Profile object
and there is no separate AddressBook object. For this reason, the AddressBook ID is
always the customer profile ID.
Note: this class allows access to sensitive personal and private information. Pay attention to appropriate legal and regulatory requirements when developing.
Properties
addresses
:
List
(Read Only)
A sorted list of addresses in the address book. The addresses
are sorted so that the preferred address is always sorted first. The
remaining addresses are sorted alphabetically by ID.
preferredAddress
:
CustomerAddress
The address that has been defined as the customer's preferred
address.
Constructor Summary
This class does not have a constructor, so you cannot create it directly.
Method Summary
createAddress(name
:
String)
:
CustomerAddress
Creates a new, empty address object with the specified name.
getAddress(id
:
String)
:
CustomerAddress
Returns the address with the given name from the address book.
getAddresses()
:
List
Returns a sorted list of addresses in the address book.
getPreferredAddress()
:
CustomerAddress
Returns the address that has been defined as the customer's preferred address.
removeAddress(address
:
CustomerAddress)
:
void
Removes the specified address from the address book.
setPreferredAddress(anAddress
:
CustomerAddress)
:
void
Sets the specified address as the customer's preferred address.
Methods inherited from class
Object
assign, create, create, defineProperties, defineProperty, entries, freeze, fromEntries, getOwnPropertyDescriptor, getOwnPropertyNames, getOwnPropertySymbols, getPrototypeOf, hasOwnProperty, is, isExtensible, isFrozen, isPrototypeOf, isSealed, keys, preventExtensions, propertyIsEnumerable, seal, setPrototypeOf, toLocaleString, toString, valueOf, values
Salesforce Commerce Cloud Courses
Salesforce B2C Commerce Developer - Certification Tests
Why risk failing the SFCC exam? Get 180 real questions, killer content, and everything you need to crush the Salesforce B2C Commerce Developer certification.
Becoming a Salesforce B2C Commerce Developer is your ticket to higher salaries, better job opportunities, and the credibility to stand out from the competition. But let's be honestβpassing the certification exam isn't easy. That's where we come in.
Becoming a Salesforce B2C Commerce Developer is your ticket to higher salaries, better job opportunities, and the credibility to stand out from the competition. But let's be honestβpassing the certification exam isn't easy. That's where we come in.
Salesforce Javascript Developer I - Certification Tests
Not just another prep courseβthis is your shortcut to passing. Master JavaScript for Salesforce and go from 'hoping to pass' to knowing you will. Ready to start?
This isn't just another prep courseβit's your shortcut to mastering the skills and confidence you need to pass. With multiple practice tests covering every section and a final exam simulation designed to mirror the real thing, you'll feel like you've already aced it before test day.
This isn't just another prep courseβit's your shortcut to mastering the skills and confidence you need to pass. With multiple practice tests covering every section and a final exam simulation designed to mirror the real thing, you'll feel like you've already aced it before test day.
Salesforce B2C Commerce Architect - Certification Tests
Think the Developer exam was hard? Welcome to the next level.
The Salesforce B2C Commerce Architect certification is a whole different gameβcomplex solutions, elevated difficulty, and skills that set you apart in the eCommerce industry. That's why we're including 11 downloadable PDF guides, packed with best practices and strategies to help you prepare for the exam and build confidence in every topic.
The Salesforce B2C Commerce Architect certification is a whole different gameβcomplex solutions, elevated difficulty, and skills that set you apart in the eCommerce industry. That's why we're including 11 downloadable PDF guides, packed with best practices and strategies to help you prepare for the exam and build confidence in every topic.
Method Detail
createAddress
Creates a new, empty address object with the specified name.
Parameters:
name
-
the ID of the address to create, must not be null.
Returns:
the new address object or null if an address with the given name already exists in the address book.
Throws:
NullArgumentException
-
If passed 'name' is null.
IllegalArgumentException
-
If passed 'name' is not null, but an empty string.
getAddress
Returns the address with the given name from the address book. The name
is a unique identifier of the address within the address book.
Parameters:
id
-
An address ID, must not be null.
Returns:
The Address object or null if the address does not exist.
Throws:
NullArgumentException
-
If passed 'id' is null.
IllegalArgumentException
-
If passed 'id' is not null, but an empty string.
getAddresses
getAddresses()
:
List
Returns a sorted list of addresses in the address book. The addresses
are sorted so that the preferred address is always sorted first. The
remaining addresses are sorted alphabetically by ID.
Returns:
Sorted List of customer addresses in the address book.
getPreferredAddress
getPreferredAddress()
:
CustomerAddress
Returns the address that has been defined as the customer's preferred
address.
Returns:
the default CustomerAddress object, or null if there is no preferred address.
removeAddress
removeAddress(address
:
CustomerAddress)
:
void
Removes the specified address from the address book. Because an address
can be associated with a product list, you may want to verify if the
address is being used by a product list. See ProductListMgr.findAddress().
Parameters:
address
-
the address to remove, must not be null.
setPreferredAddress
setPreferredAddress(anAddress
:
CustomerAddress)
:
void
Sets the specified address as the customer's preferred address. If null
is passed, and there is an existing preferred address, then the address
book will have no preferred address.
Parameters:
anAddress
-
the address to be set as preferred, or null if the goal is to unset the existing preferred address.