platform-custom-field-generate

Generates and validates Salesforce CustomField metadata XML to prevent deployment errors.

Updated Jul 2, 2026
One-click install
npx skills add https://github.com/padjei/SF_Build --skill platform-custom-field-generate-padjei
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: platform-custom-field-generate
Source: https://github.com/padjei/SF_Build/tree/main/.claude/skills/platform-custom-field-generate
Command: npx skills add https://github.com/padjei/SF_Build --skill platform-custom-field-generate-padjei

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Salesforce CustomField metadata deployments frequently fail due to subtle XML constraint violations, especially with Roll-Up Summary fields, Master-Detail relationships, and formula fields. This Skill encodes the mandatory Metadata API rules so generated field XML deploys successfully on the first attempt. ## Core Features & Use Cases - Field Metadata Generation: Produces valid CustomField XML for all field types including Text, Number, Picklist, Lookup, Master-Detail, Formula, and Roll-Up Summary. - Constraint Validation: Enforces critical rules such as forbidden attributes on Master-Detail fields, fully qualified summaryForeignKey formats, and CDATA-wrapped formulas. - Deployment Error Troubleshooting: Maps common Metadata API error messages to their root causes and fixes. - Use Case: When asked to create a Roll-Up Summary field summing line item amounts on an Order, the Skill outputs XML with the correct Summary type, fully qualified field references, and no forbidden precision or scale attributes. ## Quick Start Ask the AI to create a Salesforce custom field, for example: generate a Roll-Up Summary field on Order that sums the Amount field from Order Line Items.

Frequently Asked Questions about platform-custom-field-generate

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

FAQPage Schema
How do I create a Roll-Up Summary field in Salesforce metadata?▼

Set the type to Summary, specify a summaryOperation (count, sum, min, or max), and provide summaryForeignKey in the format ChildObject__c.MasterDetailField__c. For sum, min, and max, also include summarizedField in the fully qualified ChildObject__c.FieldName__c format, and never include precision or scale.

Why does my Master-Detail field deployment fail with required or deleteConstraint errors?▼

Master-Detail fields forbid the required, deleteConstraint, and lookupFilter attributes because they are always required and always cascade deletes. Remove these attributes and keep only referenceTo, relationshipName, and relationshipOrder.

How do I write a formula field in Salesforce Metadata API XML?▼

Set the type tag to the formula's result type such as Number or Text, never Formula itself. Wrap the formula content in a CDATA section and set formulaTreatBlanksAs to BlankAsZero for numeric results or BlankAsBlank for text and date results.

What is the difference between Lookup and Master-Detail field metadata?▼

Lookup fields support required, deleteConstraint, and lookupFilter attributes, while Master-Detail fields forbid all three but require relationshipOrder. Master-Detail fields are limited to two per object and enable Roll-Up Summary fields on the parent.

Why does my Salesforce field deployment fail with invalid XML tags error?▼

This error occurs when XML comments appear before the root CustomField element in the field-meta.xml file. Remove all comments placed before the root element so the parser can process the file.

What are the limits on relationship fields per Salesforce object?▼

An object supports a maximum of 2 Master-Detail relationships and 15 Lookup relationships. For additional relationships beyond two Master-Detail fields, use Lookup fields instead.