Custom object types: keys, storage scope and quotas
When custom data belongs on a system object and when it needs a custom object type, how to define the type (key attribute, Data Replication, Storage Scope, attribute groups) on staging, how CustomObjectMgr creates and queries instances, and how quotas and purge jobs keep object volume in check.
Given a business need to store custom data, determine if a custom object is needed and create and configure as required.
~8 min read · 9 practice questions ·
What the exam expects
- Decide whether a storage need belongs in a custom attribute on a system object or in a new custom object type.
- Define a custom object type on its General tab (ID, Key Attribute, Data Replication, Storage Scope), add attribute definitions and an attribute group that lets merchandisers create objects.
- Choose organization or site storage scope, and create types on staging so replication carries them to production.
- Create, look up and query instances with
CustomObjectMgrinside a transaction, using thecustom.prefix and closing iterators. - React to custom object quota warnings with purge jobs and quota alerts rather than code workarounds.
Key terms: custom object type (a definition, created for the organization, of a business object B2C Commerce does not supply); custom object (one instance of a type); key attribute (the attribute that holds each instance's unique key); storage scope (whether instances are organization-wide or per site); Data Replication (whether instances replicate between instances, fixed at creation); object quota (a platform limit on how many persistent objects of a kind exist).
Key facts
- Detail
- System objects instead of custom objects whenever possible
- Detail
- A type is always available to the whole organization
- Detail
- Can't be changed after the type is created
- Detail
- Staging, then replicate with Object Definitions selected
- Detail
- Key attribute included in an attribute group
- Detail
UUID,creationDate,lastModified, not removable
- Detail
- 50 custom attribute definitions per custom object type
- Detail
getCustomObjectreturnsnull
- Detail
{0}
- Detail
- Only inside a begun transaction
- Detail
- 60% of the quota limit
- Detail
- Purge jobs for custom objects
Sources for this section (7)
- B2C Commerce Business Objectstrailhead.salesforce.com (opens in a new tab)
- Use Custom Object Definitionsdeveloper.salesforce.com (opens in a new tab)
- Create Custom Business Objectsdeveloper.salesforce.com (opens in a new tab)
- Class CustomObjectMgrdeveloper.salesforce.com (opens in a new tab)
- Class Transactiondeveloper.salesforce.com (opens in a new tab)
- Governance and Quotasdeveloper.salesforce.com (opens in a new tab)
- Site Performancedeveloper.salesforce.com (opens in a new tab)
- When must a type's key attribute exist, given it can be named on the General tab first?
- Why should creationDate and lastModified stay out of a custom object type's attribute group?
- Why might the Quota Status page still show an old object count right after a cleanup?
- At what share of an object quota's limit should you take corrective action?
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