arrow_backBack to Chapter

Module: Create a field

Interactive Module
infoYou're viewing as a guest — progress won't be saved. Sign in to track your progress.

Create a field

Learn how to interact with Salesforce metadata: query and deploy to create a new field on the contact object.

The Shift from UI to Agentic Metadata Management

In traditional Salesforce administration, creating a field involves navigating through multiple screens in the Setup menu: Object Manager, Fields & Relationships, New Field, and then several steps of wizard-driven configuration. While functional, this manual process is slow and prone to inconsistency. In an Agentic Engineering workflow, we shift this responsibility to Cursor. Instead of clicking buttons, we describe the desired state of our metadata, and Cursor handles the generation of the underlying XML files.

The Power of Metadata Awareness

When you ask Cursor to create a field, it doesn't just guess. Because you have a local SFDX project, Cursor can analyze your existing CustomObject and CustomField metadata files to understand your current schema. By using the right prompts, you can instruct Cursor to:

  • Audit: Scan existing fields to prevent duplicates or naming conflicts.

  • Generate: Write the precise XML structure required by the Salesforce Metadata API.

  • Deploy: Use the integrated terminal to push these changes to your org instantly.

This approach allows Solution Engineers to rapidly prototype data models for demos without getting bogged down in the Salesforce UI's latency.

Test Your Understanding

Complete this check to unlock the Discovery Checklist and Implementation Guide.

bolt

Knowledge Check

Which file extension is used to store the configuration for a single field in an SFDX project?

Why should we include 'Make sure it doesn’t already exist' in our prompt to Cursor?

Discovery Milestones

lockCOMPLETE QUIZ TO UNLOCK
lock

Verify active Salesforce Org connection

Finish previous step to unlock

lock

Create a Service Level picklist on the Contact object

Finish previous step to unlock

lock

Deploy the new field to Salesforce

Finish previous step to unlock

lock

Verify field existence in the Salesforce Org

Finish previous step to unlock

lightbulb
Expert Guidance

Work through each milestone in sequence. Opening the Implementation Blueprint for each step will give you the production-ready patterns you need to apply the concept immediately.