Custom attributes on system object types
Adding a field to Product, Content or another system object: attribute definitions and the groups that make them visible in Business Manager, value types and per-type limits, the Externally Managed flag, reading set and enum values safely in script, site custom preferences, and exposing the value through SFRA models and OCAPI's c_ properties.
Given business requirements, extend the storefront to expose a new attribute on an existing system object type.
~8 min read · 9 practice questions ·
What the exam expects
- Add a custom attribute to an existing system object type and make it visible to merchandisers through an attribute group.
- Choose a value type deliberately, knowing that changing type or language loses existing values, and apply the per-object definition limits.
- Protect feed-owned values with the Externally Managed flag.
- Read and write set-of and enum attributes correctly in script, and store per-site settings as SitePreferences custom attributes.
- Show the value on an SFRA page (model extension plus template override) and recognise it in OCAPI documents.
Key terms: system object type (a platform-defined object such as Product, Content or SitePreferences that you can extend but not create); attribute definition (the ID, display name and value type of one attribute); attribute group (the Business Manager grouping an attribute must belong to before it appears on a page); Externally Managed (a flag telling Business Manager users not to edit a feed-owned custom attribute); custom preference (a custom attribute on SitePreferences or OrganizationPreferences).
Key facts
- Detail
- Attribute must belong to an attribute group
- Detail
- Existing values are lost
- Detail
- 500 custom attribute definitions, localizable included
- Detail
- 50 custom attribute definitions
- Detail
- Custom attributes only; clear it to fix a bad feed value
- Detail
- Java-backed copies; reassign to update
- Detail
- EnumValue with a null base value
- Detail
getCustomPreferenceValuereturns null
- Detail
c_prefix
Sources for this section (5)
- Use Custom Object Definitionsdeveloper.salesforce.com (opens in a new tab)
- Class CustomAttributesdeveloper.salesforce.com (opens in a new tab)
- Class EnumValuedeveloper.salesforce.com (opens in a new tab)
- Class Sitedeveloper.salesforce.com (opens in a new tab)
- OCAPI Custom Propertiesdeveloper.salesforce.com (opens in a new tab)
- What is the cap on custom definitions for the Line Item Tax object?
- Why can't you set Externally Managed on a standard product field?
- When does
Array.isArray()return false for a value read from a product? - What does
Site.getCustomPreferenceValue()return for a preference ID that was never defined?
The questions are free to read. Answers with their sources and self-grading are included with the pack.
Keep reading with the B2C Commerce Developer pack
- Core concepts
- Exam traps
- Worked scenario
The pack includes:
- All 28 lessons of the B2C Commerce Developer guide, with reading progress
- Interactive decision walks and step-by-step sequence steppers
- Practice exams purchase adds inline bank questions and topic practice (9 questions for this lesson)
- An official source cited for every claim
- An AI tutor that answers from the guide
- Choose guide-only, practice-only, or save $4 with both