Simple Object Designer Documentation
Index

Object Numbering

Every object in Business Central has a unique ID number. This page explains how SOD manages object numbering and how to configure it properly.

Understanding Object IDs

Business Central uses numeric IDs to identify objects:

  • Tables (e.g., Table 18 = Customer)
  • Pages (e.g., Page 21 = Customer Card)
  • Fields (e.g., Field 1 on Table 18 = No.)
  • Reports, Codeunits, Queries, etc.

When SOD creates new objects (tables, pages, fields), each needs a unique ID that doesn't conflict with existing objects.

Object ID Ranges

Microsoft defines standard ranges for object IDs:

Range Usage
1 - 49,999 Reserved for Microsoft base application
50,000 - 99,999 Available for per-tenant extensions (PTE)
100,000+ Available for AppSource apps (with allocation)

SOD-generated extensions are per-tenant extensions, so they use IDs in the 50,000+ range.

Configuring Start Object Number

In the Setup page, the Start Object Number field determines where SOD begins assigning IDs.

Requirements

  • Must be 50,000 or higher
  • Must not overlap with other extensions you've installed
  • Should leave room for growth

Best Practices

  1. Check existing allocations before choosing a number
    • Review other per-tenant extensions in Extension Management
    • Check your organization's ID allocation documentation
  2. Leave buffer space between ranges
    • If using 50,000 for one extension, start the next at 51,000
    • This allows for growth without reallocation
  3. Document your allocations
    • Keep a record of which ID ranges are used by which extensions
    • Share this documentation with your team

Example Allocation Strategy

Extension Start Number End Number
SOD Customizations (Env 1) 50,000 50,999
SOD Customizations (Env 2) 51,000 51,999
Other PTE Extension 52,000 52,999

SOD's Object ID Range

SOD scans for a free 1000-ID-wide block starting at your Start Object Number and reserves it for your customizations. Tables, pages, and other objects are assigned IDs sequentially from that block. SOD manages ID assignment automatically using its internal tracking fields.

How SOD Assigns IDs

When you create a new object:

  1. SOD checks the last used number for that object type
  2. Increments to the next available number
  3. Assigns that number to your new object
  4. Updates the tracking field

This process is automatic and requires no manual intervention.

Field IDs

Fields on table extensions receive IDs within your assigned range. Each field you create gets a unique field ID.

Example: If your Start Object Number is 50,000:

  • First field you create might be Field 50,000
  • Second field might be Field 50,001
  • And so on

Watch for Field No. collisions across related tables. IDs are assigned automatically, but a sequence of field creations and deletions can leave the same Field No. on custom fields in two related tables — Customer and Contact, for example.

That matters because Business Central performs its own automated transfer between related tables and matches fields by number. Two unrelated fields sharing a number produce a type-mismatch error at data entry, posting, or publish time.

For custom fields on tables that Business Central relates (Customer/Contact, Vendor/Contact, and so on), make sure the Field No. values do not collide. Conversely, when the same logical field exists on several tables in a transfer chain, it must carry the same number everywhere. Both rules are covered in detail in Field Transfers.

Number series for feature primary keys

Number series are a separate matter from object and field IDs. To make a feature's primary key auto-generate numbers, open the Setup page for your app and assign a number series there — choosing the option in the feature wizard alone is not enough.

See Setup Page and Data Table Template.

Checking for Conflicts

Before deploying to a new environment, verify no ID conflicts exist:

Method 1: Review Extension Management

  1. Go to Extension Management
  2. Look at installed per-tenant extensions
  3. Check their object ID ranges (if documented)

Method 2: Review Deployment Errors

If you publish and get an error about duplicate object IDs:

  1. Note the conflicting ID
  2. Adjust your Start Object Number to a non-conflicting range
  3. Re-create your customizations in the new range

Method 3: Check app.json Files

If you have access to other extensions' source:

  1. Look at their app.json files
  2. Check the idRanges section
  3. Ensure your range doesn't overlap

Changing Object Numbers

Warning: Changing the Start Object Number after creating objects is problematic.

If you need to change the range:

  1. Export your configuration
  2. Uninstall the existing customization extension
  3. Delete existing SOD data (carefully)
  4. Configure the new Start Object Number
  5. Re-create your customizations
  6. Publish to the new range

This is disruptive, so choose your initial range carefully.

Multi-Environment Considerations

If you use SOD in multiple environments:

Same Customizations, Multiple Environments

Use the same Start Object Number across environments. The generated extension will have consistent IDs.

Different Customizations Per Environment

Use different Start Object Numbers for each environment to avoid confusion and potential conflicts.

Troubleshooting Object Numbers

"Object ID Already Exists" Error

Cause: Your ID range conflicts with another extension.

Solution:

  1. Choose a different Start Object Number
  2. Re-create customizations in the new range

Running Out of IDs

Cause: You've used most of the 1000-ID block.

Solution:

  1. Contact Hougaard support for guidance
  2. Consider splitting customizations across multiple extensions
  3. Review if all objects are necessary

Objects Using Unexpected IDs

Cause: Last Table No. or Last Page No. tracking got out of sync.

Solution:

  1. Review the tracking fields in Setup
  2. Manually adjust if necessary
  3. Contact support if issues persist

Compiler errors about IDs

Error Meaning Action
PTE0002: Field '<name>' has an ID of [nn]. It must be within the range '[50000..99999]' A generated field was assigned an ID below 50,000. Per-tenant extension fields must sit in 50,000–99,999 Ensure the Start Object Number is 50,000 or higher
AL0206: A field with ID <nn> is already defined in Table '<Table>' by the extension '<extension>' The field ID collides with a field another extension — often the Base Application — already defines on that table Move to a non-conflicting range; see "Object ID Already Exists" above
AL0297: The application object identifier '<id>' is not valid. It must be within the allowed ranges '[<from>..<to>]' A generated object was assigned an ID outside the range allocated to the environment or app Correct the Start Object Number, remembering the 1000-ID block SOD reserves

Field number validation demands an unexpectedly high number

Symptom: creating a new table or feature, SOD rejects the field number you enter and insists on a value in a much higher range — demanding 50,500 when you normally assign 10, 20, 30.

Cause: a confirmed bug in SOD, not intended behaviour.

Resolution: update SOD to the latest version via Extension Management — the fix shipped in a SOD update. See Updating SOD.