salesforce-web-app-creating-records

Create Salesforce records from React web apps using createRecord and handle returned record IDs.

803|289|Updated Nov 7, 2025
One-click install
npx skills add https://github.com/forcedotcom/afv-library --skill salesforce-web-app-creating-records
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: salesforce-web-app-creating-records
Source: https://github.com/forcedotcom/afv-library/tree/main/skills/salesforce-web-app-creating-records
Command: npx skills add https://github.com/forcedotcom/afv-library --skill salesforce-web-app-creating-records

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps developers create Salesforce records from React web applications, streamlining data entry and reducing manual steps.

Core Features & Use Cases

  • Create Salesforce records (Lead, Contact, or Application__c) from a web UI using createRecord.
  • Handle IDs robustly by extracting the new record ID from result.id or result.fields.Id.value to support API variations.
  • Guardrails ensure only existing fields are sent and objects are deployed before usage.

Quick Start

Create a Lead in Salesforce from a React web form and return the new record ID.

Frequently Asked Questions about salesforce-web-app-creating-records

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

FAQPage Schema
How do I create Salesforce records from a React web app?

To create Salesforce records from a React web app, use the createRecord function from @salesforce/webapp-experimental/api to pass existing fields and submit new leads, contacts, or custom objects directly from your web UI.

How do I get the record ID from a createRecord response in Salesforce?

To get the record ID from a createRecord response, handle API variations by extracting it from either result.id or result.fields.Id.value. This ensures you robustly capture the newly created record identifier.

Can I create custom Salesforce objects using createRecord in React?

Yes, you can create custom Salesforce objects like Application__c using createRecord in React. You must align with the org's metadata and ensure the custom objects are deployed before relying on them in your web app.

What fields should I send when creating Salesforce records from a web application?

When creating Salesforce records from a web application, you should only send existing fields. Guardrails in this approach ensure your payload aligns with the org's metadata, preventing errors from invalid field submissions.

Why is my createRecord call failing in my React Salesforce app?

Your createRecord call might fail if the target objects are not deployed in the org's metadata or if you are sending non-existing fields. Ensure all objects are deployed and only valid fields are included in your request payload.