---
session: "fix-new-campaign-name-layout"
branch: "dev/system-administrator/fix-new-campaign-name-layout"
tidb_branch: "bran-sxsotnw7izcpzagzebxc2wczka"
date: "2026-03-26T04:37:58.526Z"
status: pending
---

# Configuration Change Request: Fix Campaign New Form — Field Metadata & Layout

## Summary

Corrected `_System_Field` metadata for the Campaign object so the "New Campaign" form renders correctly (editable Name/Owner, required asterisks, no statistics section, correct labels). Also updated `_System_PageLayout` section labels to title-case.

## Changes

### System Data / Metadata — `_System_Field`

**1. Campaign.Name — unmark as system field, set required, fix label**

Root cause: `IsSystem = 1` caused `editableForNew = false`; `Required = 0` caused `nillable = true` (no asterisk); label was "Name" instead of "Campaign Name".

```sql
UPDATE _System_Field f
JOIN _System_Object o ON o.Id = f.ObjectId
SET f.IsSystem = 0, f.Required = 1, f.Label = 'Campaign Name'
WHERE o.ApiName = 'Campaign' AND f.ApiName = 'Name';
```

**2. Campaign.OwnerId — unmark as system field, fix label**

Root cause: `IsSystem = 1` caused `editableForNew = false`; label was "Owner ID" instead of "Campaign Owner".

```sql
UPDATE _System_Field f
JOIN _System_Object o ON o.Id = f.ObjectId
SET f.IsSystem = 0, f.Label = 'Campaign Owner'
WHERE o.ApiName = 'Campaign' AND f.ApiName = 'OwnerId';
```

**3. Campaign.CurrencyIsoCode — set required, fix label**

Root cause: `Required = 0` caused no asterisk; label was "Currency ISO Code" instead of "Campaign Currency".

```sql
UPDATE _System_Field f
JOIN _System_Object o ON o.Id = f.ObjectId
SET f.Required = 1, f.Label = 'Campaign Currency'
WHERE o.ApiName = 'Campaign' AND f.ApiName = 'CurrencyIsoCode';
```

**4. Campaign.ParentId — fix label**

```sql
UPDATE _System_Field f
JOIN _System_Object o ON o.Id = f.ObjectId
SET f.Label = 'Parent Campaign'
WHERE o.ApiName = 'Campaign' AND f.ApiName = 'ParentId';
```

**5. Campaign statistics rollup fields — mark as formula/calculated**

Root cause: Fields were imported as plain numeric fields (`IsSystem = 0`, no `Formula`), causing them to appear as editable inputs on the create form. Marking as `formula` type causes both `transformLayout` (`editableForNew = false`) and the frontend form filter (`calculated = true`) to exclude them.

```sql
UPDATE _System_Field f
JOIN _System_Object o ON o.Id = f.ObjectId
SET f.Type = 'formula', f.Formula = 'rollup'
WHERE o.ApiName = 'Campaign'
  AND f.ApiName IN (
    'NumberOfResponses', 'NumberOfOpportunities', 'NumberOfLeads',
    'NumberOfWonOpportunities', 'NumberOfConvertedLeads',
    'AmountAllOpportunities', 'NumberOfContacts', 'AmountWonOpportunities'
  );
```

**6. Campaign planning fields — set default value to 0**

```sql
UPDATE _System_Field f
JOIN _System_Object o ON o.Id = f.ObjectId
SET f.DefaultValue = '0'
WHERE o.ApiName = 'Campaign' AND f.ApiName IN ('NumberSent', 'ExpectedResponse');
```

### UI Configuration — `_System_PageLayout`

Updated the default Campaign page layout section labels to title-case and removed a stray empty-string field from the Planning section.

```sql
-- The Config JSON column was updated directly.
-- Equivalent logical changes:

-- Section label updates (within the JSON Config of the default Campaign layout):
--   "Information"        → "Campaign Information"
--   "" (empty)           → "Description"
--   "PLANNING"           → "Planning"
--   "CAMPAIGN STATISTICS"→ "Campaign Statistics"
--   "CUSTOM LINKS"       → "Custom Links"

-- Also removed a stray empty-string entry from the Planning section's fields array.
```

To reproduce via the backend API (after applying field fixes above and restarting the backend):

```bash
# GET the current layout, update section labels, POST back
curl -X POST http://<host>/services/data/v63.0/ui-api/layout/Global \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '<updated layout JSON with corrected section labels>'
```

## Rollback

```sql
-- Revert Campaign.Name
UPDATE _System_Field f JOIN _System_Object o ON o.Id = f.ObjectId
SET f.IsSystem = 1, f.Required = 0, f.Label = 'Name'
WHERE o.ApiName = 'Campaign' AND f.ApiName = 'Name';

-- Revert Campaign.OwnerId
UPDATE _System_Field f JOIN _System_Object o ON o.Id = f.ObjectId
SET f.IsSystem = 1, f.Label = 'Owner ID'
WHERE o.ApiName = 'Campaign' AND f.ApiName = 'OwnerId';

-- Revert CurrencyIsoCode
UPDATE _System_Field f JOIN _System_Object o ON o.Id = f.ObjectId
SET f.Required = 0, f.Label = 'Currency ISO Code'
WHERE o.ApiName = 'Campaign' AND f.ApiName = 'CurrencyIsoCode';

-- Revert ParentId
UPDATE _System_Field f JOIN _System_Object o ON o.Id = f.ObjectId
SET f.Label = 'Parent Campaign ID'
WHERE o.ApiName = 'Campaign' AND f.ApiName = 'ParentId';

-- Revert statistics fields
UPDATE _System_Field f JOIN _System_Object o ON o.Id = f.ObjectId
SET f.Type = 'double', f.Formula = NULL
WHERE o.ApiName = 'Campaign'
  AND f.ApiName IN (
    'NumberOfResponses', 'NumberOfOpportunities', 'NumberOfLeads',
    'NumberOfWonOpportunities', 'NumberOfConvertedLeads',
    'AmountAllOpportunities', 'NumberOfContacts', 'AmountWonOpportunities'
  );

-- Revert planning defaults
UPDATE _System_Field f JOIN _System_Object o ON o.Id = f.ObjectId
SET f.DefaultValue = NULL
WHERE o.ApiName = 'Campaign' AND f.ApiName IN ('NumberSent', 'ExpectedResponse');
```
