generating-custom-field

Generate and validate Salesforce CustomField metadata XML for standard, relationship, formula, and roll-up types.

803|289|Updated Nov 7, 2025
One-click install
npx skills add https://github.com/forcedotcom/sf-skills --skill generating-custom-field-forcedotcom
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: generating-custom-field
Source: https://github.com/forcedotcom/sf-skills/tree/main/skills/generating-custom-field
Command: npx skills add https://github.com/forcedotcom/sf-skills --skill generating-custom-field-forcedotcom

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill prevents Salesforce Metadata API deployment failures by enforcing mandatory, field-type-specific rules when generating CustomField XML, especially for high-risk field types like Master-Detail relationships and Roll-Up Summary fields.

Core Features & Use Cases

  • Custom Field XML generation with mandatory constraints: Ensures required tags and correct API naming (e.g., fullName format) plus meaningful description and inlineHelpText.
  • Relationship and formula correctness: Applies strict rules for Lookup vs Master-Detail fields, and enforces correct formula construction using CDATA and the proper formulaTreatBlanksAs behavior.
  • Roll-Up Summary deployment error prevention: Enforces the required elements and forbids attributes that cause roll-up failures (e.g., precision/scale on Summary, and summarizedField rules for sum/min/max).

Quick Start

Use the generating-custom-field skill to create and validate the CustomField metadata for a new Roll-up Summary field you want to deploy without Metadata API errors.

Frequently Asked Questions about generating-custom-field

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate Salesforce custom field metadata XML without deployment errors?

To generate Salesforce custom field metadata without deployment errors, you must enforce mandatory XML attributes, strict type-specific rules, and correct CDATA-wrapped formula generation to avoid common API failures.

Why does my Salesforce roll-up summary field fail Metadata API deployment?

Salesforce roll-up summary field deployment fails when required elements are missing or forbidden attributes like precision and scale are present on the Summary tag. Enforcing summarizedField rules for sum, min, and max prevents this.

What is the correct format for Salesforce formula fields in metadata XML?

The correct format for Salesforce formula fields in metadata XML requires wrapping the formula syntax in CDATA tags and configuring the proper formulaTreatBlanksAs behavior to ensure correct processing and deployment.

How do I set up Master-Detail relationship fields using Salesforce metadata XML?

Setting up Master-Detail relationship fields using Salesforce metadata XML requires applying strict rules for Lookup versus Master-Detail fields, ensuring correct API naming conventions, and enforcing mandatory constraints to prevent deployment failures.

Can I troubleshoot existing Salesforce custom field deployment errors with this approach?

Yes, you can troubleshoot existing Salesforce custom field deployment errors by validating against Master-Detail constraints, roll-up summary formatting rules, and formula CDATA requirements to identify and correct metadata XML issues.

What are the limitations when generating custom field metadata for Salesforce?

Limitations when generating custom field metadata for Salesforce include strict enforcement of type-specific rules, mandatory XML attributes, and forbidden attributes on roll-up summaries, meaning non-standard or invalid configurations will be rejected.