# Saving & Activation Issues

## Component Not Saving

#### Symptom

Changes don't save or error appears when clicking the Save button.

### Common Causes and Solutions

#### 1. Required Fields Missing

**Check**: Component name and other required properties must be filled.

**Solution**:

* Ensure component has a unique name
* Verify all required properties are configured
* Check for red error indicators in the builder

#### 2. Invalid Configuration

**Check**: Property values may have syntax errors.

**Solution**:

* Review error message for specific field
* Check SOQL syntax in data source configurations
* Verify field API names are correct
* Test queries in Developer Console first

#### 3. Metadata API Limits

**Check**: Component may be too large or complex.

**Understanding Salesforce Limits**:

Dynamic Components are stored as Custom Metadata records in Salesforce with a well-architected structure:

**Component Storage Architecture**:

* Component definition field (JSON): Stores component structure
* Query structure field: Stores data source configurations
* Styling structure field: Stores CSS and styling rules
* Interaction structure field: Stores actions and event logic

Each field is a Long Text field with a 131,072 character limit.

**Why Size Limits Are Rarely Hit**:

With dedicated fields for each component aspect, you would need an extremely large and complex component to exceed limits:

* Thousands of nested elements
* Hundreds of data sources
* Massive amounts of custom CSS
* Extremely complex interaction chains

**More Common Issues (Not Size-Related)**:

The "too large or complex" error is often not actually about size limits, but rather:

1. Metadata API timeout - Salesforce times out the save operation (not the component being too large)
2. Concurrent deployment conflicts - Another metadata operation blocking the save
3. Org performance issues - General Salesforce performance degradation

**Real Warning Signs**:

* Save operations consistently taking 30+ seconds
* Timeout errors during save (not "exceeds size" errors)
* Intermittent failures that succeed on retry

**Actual Solutions**:

If you see genuine timeout errors:

* Wait and retry (often resolves automatically)
* Check for concurrent deployments
* Try during off-peak hours
* Contact support if consistently failing

If component is genuinely too complex:

* You'll see specific "exceeds maximum size" error
* This is extremely rare with current architecture
* Split into multiple components only if specifically instructed by error message

**Best Practice**:

Don't preemptively simplify components due to size concerns. The architecture handles complexity well. Only simplify if you encounter actual errors specifically mentioning size or if save operations consistently timeout

#### 4. Concurrent Deployment Conflicts

**Check**: Dynamic Components are saved as custom metadata in Salesforce. If another deployment or metadata operation is happening simultaneously, it can block the save operation.

**Solution**:

* Wait a few minutes and try saving again
* Check Setup > Deployment Status for active deployments
* Avoid saving during scheduled deployments or releases
* Coordinate with admins if frequent conflicts occur
* Note: Large components may take 30-60 seconds to save - be patient and don't click Save multiple times

Common scenarios that cause conflicts:

* Change sets being deployed
* Managed package installations or upgrades
* Other Dynamic Components being saved by different users
* Metadata API operations running (e.g., from VS Code, workbench)
* Scheduled automation deploying metadata

#### 5. Browser Issues

**Check**: Browser cache or extension may interfere.

**Solution**:

* Clear browser cache
* Disable browser extensions
* Try different browser
* Check browser console for JavaScript errors (F12)

***

## Component Not Appearing on Lightning Page

#### Symptom

Dynamic Component created but doesn't show in Lightning App Builder component list.

#### Common Causes and Solutions

1\. Component Not Activated

**Check**: Components must be activated before use.

**Solution**:

1. Open component in Dynamic Components builder
2. Click "Activate" button
3. Wait for activation confirmation
4. Refresh Lightning App Builder

2\. Using Wrong Bridge Component

**Check**: For Lightning pages, use the "AX - Dynamic Component" bridge component.

**Solution**:

1. In Lightning App Builder, find "AX - Dynamic Component"
2. Drag onto page
3. In Component Name dropdown, select your created Dynamic Component
4. Configure Display as Card if needed

3\. Component Name Not Appearing in Dropdown

**Check**: Component may not be fully activated or saved.

**Solution**:

* Verify component shows as "Active" in Dynamic Components app
* Try deactivating and reactivating the component
* Refresh your browser completely (Ctrl+Shift+R or Cmd+Shift+R)
* Check that component was saved successfully before activation
