---
title: Miscellaneous Contracts — Validation Rules
aliases: [misc validation, utility-contract validation, lightweight-contracts]
sources:
    [
        rcg-mobile-dev-agent/raw/006-contract-types-matrix.md,
        rcg-mobile-dev-agent/wiki/contracts/bohelper.md,
        rcg-mobile-dev-agent/wiki/contracts/locale.md,
        rcg-mobile-dev-agent/wiki/contracts/validation-messages.md,
        rcg-mobile-dev-agent/wiki/contracts/domain-repository.md,
        rcg-mobile-dev-agent/wiki/contracts/image.md,
        rcg-mobile-dev-agent/wiki/contracts/global-labels.md,
        rcg-mobile-dev-agent/wiki/contracts/package.md,
        rcg-mobile-dev-agent/wiki/contracts/actor-repository.md,
    ]
last_updated: 2026-04-26
status: seed
---

# Miscellaneous Contracts — Validation Rules

Covers authoring-facing validation for the lightweight contract types: **BusinessObjectHelper**, **Locale**, **ValidationMessages**, **DomainRepository**, **Image**, **GlobalLabels**, **Package**, and **ActorRepository**. These types have simpler validation surfaces than BO/LO/DS/UI but still share cross-cutting rules. They're grouped on one page because each type has only a handful of authoring rules — a dedicated page per type would be over-weighting them.

## Cross-cutting rules (apply to every contract type)

Two workspace-wide rules fire during every validation run, regardless of contract type:

-   Contract names must be unique across the whole workspace. If two files — even of different contract types — share the same root `@name`, both are rejected.
-   A deployment may declare at most 5 "platform objects" (business objects tagged for quick-action surfaces). Exceeding this cap is rejected.

Files must also be readable, well-formed XML with a recognized root element, otherwise a fatal error fires before any type-specific rule runs.

## BusinessObjectHelper (BoHelper)

A BOHelper (`.businessobjecthelper.xml`) is a reusable set of SimpleProperties and Methods that BOs can compose. It's technically a "partial-validation" type in the framework catalog but has a full cross-contract validator anyway.

### Must

-   Root element is `<BusinessObjectHelper>`; the root `@name` must match the pattern `BoHelper.+`.
-   File name starts with `BoHelper` and ends with `.businessobjecthelper.xml`. Custom BOHelpers start with `My` (or your customizing prefix) in both the file name and the root `@name`.
-   Each SimpleProperty's `@type` must resolve either to a JavaScript base type or to a Domain declared in DomainRepository.
-   Each non-standard `<Method @name>` (except `createAsync`) must have a matching BL file — missing BLs are warned.

### Must not

-   Two SimpleProperties within a BOHelper cannot share a name; two Methods cannot share a name.
-   Reserved method names (`loadAsync`, `beforeLoadAsync`, `saveAsync`, etc.) are disallowed inside a BOHelper — those belong on BOs.

### Coerced

-   `xmlns="*.xsd"` on the root is stripped.

## Locale

Each Locale (`.locale.xml`) file holds translations for one language. The XSD is large (eight translation sections, 18 declared types), but the authoring-level rules are thin.

### Must

-   Root element is `<Locale>`.
-   Custom Locales start with the customizing indicator in the file name.
-   Every `<language>_<languageCode>` combination must be unique across all Locale contracts in the workspace — two files claiming the same locale are rejected.
-   `Label @id` values must be unique inside each translation section (per-section uniqueness, not global); component ids (UI / process / BO / AdvancedSearchObject / PrintLayout) must be unique; image ids in the `Images` section must be unique.

### Must not

-   Duplicate `<language>_<languageCode>` across Locale contracts.

### Coerced

-   `xmlns="*.xsd"` on the root is stripped.

## ValidationMessages

The ValidationMessages contract is tiny — a flat list of named messages. Its XSD is 18 lines and its validator is 60.

### Must

-   Root element is `<ValidationMessages>`.
-   File name starts with the core or customizing prefix and ends with `.validationmessages.xml`. Custom files start with the customizing prefix in both the file name and the root `@name`.
-   Every `ValidationMessage @name` is unique within the file.

### Must not

-   Two messages cannot share a name.

### Coerced

-   `xmlns="*.xsd"` on the root is stripped.

## DomainRepository

DomainRepository is the dictionary of Domain types that tables, BOHelpers, and BO SimpleProperties reference by name. There's only ever one `Domains.xml` per workspace.

### Must

-   Root element is `<DomainRepository>`; every `<Domain>` declares `@name`, `@baseType`, and `@length`.
-   Each `<Initializer>` contains exactly one `<Default>` and one `<Empty>` (the XSD uses `xs:all`, so the order is free but both must be present).
-   File name must be exactly `Domains.xml` — no prefix, no customizing variant.
-   Inside each `<Initializer><Default>`, either `value` or `nullable` must be set.

### Must not

-   A Domain cannot have a `@name` that is missing, empty, or starts with `__` (reserved for framework-internal domains).

### Coerced

-   Missing `@length` is warned; missing `@baseType` is warned. Add both rather than relying on the warning.
-   `xmlns="*.xsd"` on the root is stripped.

## Image

An Image contract (`.image.xml`) declares a 3-tier platform/device hierarchy: OS-specific image → device-specific image → default image.

### Must

-   Root element is `<Image>`.
-   File name ends with `.image.xml`. Custom images start with the customizing indicator in both the file name and the root `@id`.
-   Every `<Image>` must have `id`; every `<Default>` must have `mimetype`.

### Must not

-   Within a single container, there can be only one of each OS variant, one of each device variant, and one default entry — duplicates are rejected.

### Coerced

-   The XSD intentionally leaves `@mimetype` as an open `xs:string` (the enum is commented out in `Image.xsd`) — any value is accepted.
-   `xmlns="*.xsd"` on the root is stripped.

## GlobalLabels

GlobalLabels is the simplest contract type — its XSD maps to a root `<Global>` (note: not `<GlobalLabels>`) that holds a flat list of labels.

### Must

-   Root element is `<Global>` (not `<GlobalLabels>`, despite the contract-type name).

### Must not

-   Two `<Label @id>` values cannot match (case-insensitive) within the file.

### Coerced

-   `xmlns="*.xsd"` on the root is stripped.

## Package

Package (`package.xml`) declares which Salesforce releases a deployment targets and which managed packages it depends on.

### Must

-   Root element is `<package>` (lowercase — unique among modeler contracts).
-   File name is exactly `package.xml` — no prefix, no variant.
-   Each `<DependencyIdentifier>` must be either `Consumer Goods Cloud - Mobile App` or `Consumer Goods Cloud - Managed Package`.
-   Each `<DependencyMajorVersionNumber>` must be one of the enumerated Salesforce release numbers (252, 254, 256, …, 282 — even numbers only).

### Must not

-   The Package contract cannot be `MODIFIED_CORE` — Package is always authored in the customizing layer.
-   Two `<dependency @id>` entries cannot share an id.
-   No more than 2 `<dependency>` entries total (XSD-enforced cap).

### Coerced

-   `xmlns="*.xsd"` on the root is stripped.

## ActorRepository

ActorRepository holds named "actors" (roles, personas) referenced elsewhere in the workspace. Validator is 28 lines — trivial.

### Must

-   Root element is `<ActorRepository>`.

### Must not

-   Two `<Actor @name>` entries cannot match (case-insensitive) within the file.

### Coerced

-   `xmlns="*.xsd"` on the root is stripped.

## Reference

-   Internal schema references (one per contract type, in the primary repo):
    -   `rcg-mobile-dev-agent/wiki/contracts/bohelper.md`
    -   `rcg-mobile-dev-agent/wiki/contracts/locale.md`
    -   `rcg-mobile-dev-agent/wiki/contracts/validation-messages.md`
    -   `rcg-mobile-dev-agent/wiki/contracts/domain-repository.md`
    -   `rcg-mobile-dev-agent/wiki/contracts/image.md`
    -   `rcg-mobile-dev-agent/wiki/contracts/global-labels.md`
    -   `rcg-mobile-dev-agent/wiki/contracts/package.md`
    -   `rcg-mobile-dev-agent/wiki/contracts/actor-repository.md`
-   Cross-repo raw source: `rcg-mobile-dev-agent/raw/006-contract-types-matrix.md`.

## See also

-   [[db-tables]] — DBTable columns resolve their `@domain` against DomainRepository.
-   [[business-objects]] — BO SimpleProperties resolve their `@type` against DomainRepository.
-   [[user-interface]] — UIDescriptions consume Labels (GlobalLabels) and Images.
