Deploy Salesforce layouts (FlexiPages, Layouts, CompactLayouts) with validation, backup, and profile assignments
From opspal-salesforcenpx claudepluginhub revpalsfdc/opspal-commercial --plugin opspal-salesforce--source {path} --org {org-alias}Deploy generated or modified layouts to Salesforce orgs with comprehensive pre-deployment validation, automatic backup creation, profile assignments, and post-deployment verification.
ā Use this command when:
/design-layoutā Do NOT use this command for:
/design-layout instead)/analyze-layout instead)sf project deploy instead)sf)/deploy-layout --source {path} --org {org-alias}
/deploy-layout --source {path} --org {org-alias} --dry-run
/deploy-layout --source {path} --org {org-alias} --profiles "Sales User,Support User" --layout "Account-Sales Layout"
/deploy-layout --backup {object} --org {org-alias}
/deploy-layout --rollback {backup-path} --org {org-alias}
/deploy-layout --verify {object} --org {org-alias}
sf org list--source: Path to layout source directory or file
--backup: Object name to backup existing layouts
--rollback: Path to backup directory to restore
--verify: Object name to verify deployment
--dry-run: Validate without deploying
--check-only: Run check-only deployment
--profiles: Comma-separated profiles for assignment
--record-types: Comma-separated record types
--layout: Layout name for profile assignment
--ignore-warnings: Continue despite deployment warnings
--verbose: Show detailed output
Step 1: Pre-Deployment Validation
Step 2: Create Backup (Production)
Step 3: Deploy Metadata
sf project deploy startStep 4: Profile Assignments (if specified)
Step 5: Post-Deployment Verification
Step 6: Display Results
/deploy-layout --source ./output/layouts --org my-sandbox --verbose
ā Connected to: user@sandbox.company.com
š Running pre-deployment validation...
ā Pre-deployment validation passed
š¦ FlexiPages: 2
š¦ Layouts: 3
š¦ CompactLayouts: 2
š¦ Creating backup at .backups/my-sandbox/Account_2025-12-12T14-30-00Z...
ā Backup created successfully
š Deploying to my-sandbox...
Deploying: Account_Sales_FlexiPage.flexipage-meta.xml
Deploying: Account_Sales_Layout.layout-meta.xml
Deploying: Account_Sales_CompactLayout.compactLayout-meta.xml
ā Deployment successful
š Verifying deployment for Account...
ā Found 3 FlexiPage(s)
ā Found 2 CompactLayout(s)
š Summary:
Total components: 7
Deployed successfully: 7
Errors: 0
Warnings: 0
ā Deployment complete
/deploy-layout --source ./output/layouts --org my-sandbox --dry-run
ā Connected to: user@sandbox.company.com
š Running pre-deployment validation...
ā Pre-deployment validation passed
š¦ FlexiPages: 2
š¦ Layouts: 3
š¦ CompactLayouts: 2
š Dry-run mode - Skipping actual deployment
Would deploy:
1. Account_Sales_FlexiPage.flexipage-meta.xml
2. Account_Sales_Layout.layout-meta.xml
3. Account_Sales_CompactLayout.compactLayout-meta.xml
4. Contact_Sales_FlexiPage.flexipage-meta.xml
5. Contact_Sales_Layout.layout-meta.xml
6. Contact_Sales_CompactLayout.compactLayout-meta.xml
7. Opportunity_Sales_FlexiPage.flexipage-meta.xml
ā Validation passed - safe to deploy
/deploy-layout --source ./output/layouts --org my-sandbox
ā Connected to: user@sandbox.company.com
š Running pre-deployment validation...
ā Pre-deployment validation failed
ā FlexiPage Account_Record_Page.flexipage-meta.xml: Missing masterLabel
ā CompactLayout Contact_Compact.compactLayout-meta.xml: Exceeds 10 field limit (12 fields)
ā ļø Layout Opportunity_Layout.layout-meta.xml: API version 55.0 is outdated
š Result: ā Failed
Cannot proceed with deployment until validation errors are fixed
š” Suggestions:
1. Add <masterLabel> to Account_Record_Page.flexipage-meta.xml
2. Reduce fields in Contact_Compact to 10 or fewer
3. Update API versions to 62.0
/deploy-layout --source ./output/layouts --org my-sandbox \
--profiles "Sales User,Sales Manager" \
--layout "Account-Sales Account Layout"
ā Connected to: user@sandbox.company.com
š Running pre-deployment validation...
ā Pre-deployment validation passed
š Deploying to my-sandbox...
ā Deployment successful
š Updating profile assignments...
ā Updated Sales User ā Account-Sales Account Layout
ā Updated Sales Manager ā Account-Sales Account Layout
š Verifying deployment...
ā Layouts deployed
ā Profile assignments updated
ā Complete
# Step 1: Generate layout
/design-layout --object Account --persona sales-rep --org my-sandbox
# Step 2: Review generated files
ls instances/my-sandbox/generated-layouts/latest/
# Step 3: Dry-run deployment
/deploy-layout --source instances/my-sandbox/generated-layouts/latest/ \
--org my-sandbox --dry-run
# Step 4: Deploy to sandbox
/deploy-layout --source instances/my-sandbox/generated-layouts/latest/ \
--org my-sandbox
# Step 5: Verify deployment
/deploy-layout --verify Account --org my-sandbox
# Step 6: Analyze deployed layout
/analyze-layout --object Account --org my-sandbox
# Step 1: Create backup
/deploy-layout --backup Account --org production
# Step 2: Deploy with check-only first
/deploy-layout --source ./layouts/ --org production --check-only
# Step 3: Full deployment
/deploy-layout --source ./layouts/ --org production
# Step 4: Verify
/deploy-layout --verify Account --org production
# If issues found - Rollback:
/deploy-layout --rollback .backups/production/Account_2025-12-12T10-00-00Z \
--org production
# Generate different layouts for different personas
/design-layout --object Opportunity --persona sales-rep --org sandbox
/design-layout --object Opportunity --persona sales-manager --org sandbox
# Deploy sales rep layout and assign
/deploy-layout --source ./output/sales-rep/ --org sandbox \
--profiles "Sales User" \
--layout "Opportunity-Sales Rep Layout"
# Deploy manager layout and assign
/deploy-layout --source ./output/sales-manager/ --org sandbox \
--profiles "Sales Manager" \
--layout "Opportunity-Sales Manager Layout"
Cause: Layout references a field that doesn't exist in target org
Solution:
Cause: Profile name doesn't match target org
Solution:
Cause: Component requires feature not available in org
Solution:
Cause: Cannot write to backup or temp directory
Solution:
--verbose to see exact pathIf deployment fails or causes issues:
node scripts/lib/layout-deployer.js <org> history
Choose the backup from before the problematic deployment
/deploy-layout --rollback .backups/<org>/<backup-name> --org <org>
/deploy-layout --verify <object> --org <org>
--dry-run to validate--verify to confirm deploymentThis command integrates with layout skills for enhanced capabilities:
skill: layout-cli-api-reference
skill: layout-planning-guide
When this command is invoked, delegate to the sfdc-layout-deployer agent:
Task: Invoke sfdc-layout-deployer agent with parameters:
- Source: {source path or backup/rollback/verify target}
- Org: {org-alias}
- Action: {deploy | backup | rollback | verify}
- Dry-Run: {dry-run flag}
- Check-Only: {check-only flag}
- Profiles: {profiles list}
- Record Types: {record-types list}
- Layout Name: {layout name for assignment}
- Verbose: {verbose flag}
Expected Deliverables:
1. Pre-deployment validation results
2. Backup confirmation (if applicable)
3. Deployment status and results
4. Profile assignment confirmation (if applicable)
5. Post-deployment verification results
Success Criteria:
- Validation passes
- Deployment succeeds
- Verification confirms deployment
- No unresolved errors
Command Version: 1.0.0 Last Updated: 2025-12-12 Part of: salesforce-plugin (Layout Designer Phase 3)