Creating a custom attribute definition on a system object type
Key Takeaway
To add a new field to existing data, create a custom attribute definition on the system object type, such as Product. Then assign it to an attribute group so merchants can see and edit it in Business Manager.
A custom attribute definition adds a new field to an existing system object type, such as Product, CustomerAddress or SitePreferences, so you can store data that the existing attributes don't cover. You create it in Business Manager under System Object Types. Merchants see the field after you place it in an attribute group. Shoppers see it after you write storefront code that shows or uses it.
Extending a system object type
B2C Commerce data is built from business objects. System objects come with the platform. Custom objects are new object types you define yourself.
Adding a custom attribute definition to a system object type lets you collect more information from shoppers, show more information on the storefront, or process orders more efficiently. Salesforce recommends using system objects instead of custom objects, and system attributes instead of custom attributes, whenever possible. Following the recommendation makes it easier to upgrade to the latest reference architecture and avoids unnecessary customization. So when a requirement needs one more field on existing data, extend the existing system object instead of building a new custom object.
Common uses include these custom attributes:
- An evening phone number on CustomerAddress
- An
addToEmailListflag on Basket - Custom preferences on SitePreferences, which holds site-specific settings
- Custom preferences on OrganizationPreferences, which holds global settings for all sites
Not every system object type can be extended. Only some system object types accept custom attribute definitions. Some are marked read-only in Business Manager.