generating-custom-object

Generate Salesforce CustomObject metadata XML with sharing model and naming constraints.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents Salesforce Custom Object metadata deployment failures by enforcing the required structure, naming rules, and critical sharing-model constraints before XML is generated.

Core Features & Use Cases

  • Correct Custom Object XML generation: Produces .object-meta.xml content with required tags like label, plural label, visibility, deploymentStatus, and nameField.
  • Sharing model decisioning with Master-Detail awareness: Automatically applies ReadWrite vs ControlledByParent based on whether the object has Master-Detail relationships, including guidance for modifying existing child objects.
  • Deployment-error prevention via validation: Applies guardrails such as omitting <fullName> from the XML root, reserved-word checks for API names, limiting Master-Detail relationships, and validation rule naming conventions.

Quick Start

Use the generating-custom-object skill to create a deployable .object-meta.xml for a new Vehicle__c custom object with a text name field and public visibility.

Frequently Asked Questions about generating-custom-object

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

FAQPage Schema
How do I generate Salesforce custom object metadata XML that deploys without errors?▼

To generate deployable custom object metadata XML safely, you must include required elements like label, plural label, visibility, deploymentStatus, and nameField while omitting the fullName tag from the XML root. This prevents Metadata API deployment failures.

Why does my custom object deployment fail when using Master-Detail relationships?▼

Custom object deployment fails with Master-Detail relationships if the sharing model is configured incorrectly. The sharing model must be set to ReadWrite instead of ControlledByParent when Master-Detail fields are present to pass Metadata API validation.

What is the correct sharing model for a Salesforce custom object?▼

The correct sharing model for a custom object is automatically derived from Master-Detail relationship presence, defaulting to ReadWrite for objects with Master-Detail fields and ControlledByParent otherwise. This ensures metadata XML passes sharing and security validation.

What naming constraints should I follow for custom object metadata XML?▼

Custom object metadata XML naming constraints require checking API names against Salesforce reserved words and following validation rule naming conventions. Adhering to these constraints prevents deployment troubleshooting issues during Metadata API processing.

Can I modify the sharing model on an existing custom object with Master-Detail fields?▼

Modifying the sharing model on an existing child object with Master-Detail fields requires specific guidance to avoid deployment errors. You must ensure the sharing model correctly reflects the Master-Detail presence within the object metadata XML.

What required elements must be present in a .object-meta.xml file?▼

A .object-meta.xml file must contain required elements including label, plural label, visibility, deploymentStatus, and nameField. Omitting the fullName from the XML root and setting deploymentStatus to Deployed ensures successful Metadata API deployment.