DEV Community

Rahul Sharma
Rahul Sharma

Posted on

CF7 to Salesforce Custom Object Not Created: A Complete Troubleshooting Guide

You have configured the "Contact Form to Any API" plugin to send Contact Form 7 submissions to a custom object in Salesforce. You have set up OAuth, entered your credentials, and mapped the fields. And yet, when a user submits the form, no record appears in your custom object.

This is a common and frustrating problem. Writing to custom objects is fundamentally different from writing to standard objects like Leads. The error messages are often vague, and the root cause is usually one of four specific configuration mistakes.

This guide walks through the exact reasons custom object creation fails and how to fix each one.

Why Custom Objects Are Different from Standard Objects

Salesforce standard objects like Lead or Contact have well-documented, predictable API names. Custom objects do not share this predictability.

Every custom object and every custom field in Salesforce has an API name that ends with __c (two underscores followed by the letter c). This suffix is not optional. If you omit it, Salesforce rejects the request with an INVALID_FIELD error, even though the field exists in the UI.

This is the single most common reason custom object creation fails.

Failure #1: The Endpoint URL Is Missing the __c Suffix

What you see: Salesforce returns a 404 Not Found error, or the request succeeds but creates a record in the wrong place.

Why it happens: The endpoint URL for a custom object must include the __c suffix. If your custom object is named Project_Request, the API endpoint must be:

/services/data/v63.0/sobjects/Project_Request__c/
Enter fullscreen mode Exit fullscreen mode

If you omit the __c, Salesforce looks for a standard object named Project_Request, which does not exist.

The fix:

In the plugin's API Endpoint URL field, verify the URL ends with __c/. For example:

https://yourdomain.my.salesforce.com/services/data/v63.0/sobjects/Project_Request__c/
Enter fullscreen mode Exit fullscreen mode

Replace yourdomain with your Salesforce instance URL and Project_Request with your actual custom object name.

How to verify: After submitting a test form, check the plugin's API Logs. A 404 error means the endpoint is wrong. A 201 Created response means the record was created successfully. For a deeper breakdown of what empty logs mean, see this guide on Contact Form 7 data not reaching the API.

Failure #2: The Field Names Are Missing the __c Suffix

What you see: Salesforce returns an INVALID_FIELD error with a message like: "No such column 'Project_Type' on sobject of type Project_Request__c".

Why it happens: Just like the object name, every custom field's API name ends with __c. If your custom field is labeled "Project Type" in the Salesforce UI, its API name might be Project_Type__c. In your JSON payload, you must use the API name, not the label.

The fix:

Step 1: In Salesforce, navigate to Setup → Object Manager → Your Custom Object → Fields & Relationships. For each field you want to map, copy the API Name exactly as shown, including __c.

Step 2: In the plugin's JSON payload, use the API name, not the label:

{
  "Name": "[your-name]",
  "Project_Type__c": "[project-type]",
  "Budget__c": "[budget-range]"
}
Enter fullscreen mode Exit fullscreen mode

Step 3: Verify the field names match exactly. One missing underscore means a failed request.

For a deeper dive into JSON structure mapping and field naming conventions, read this guide on Contact Form 7 JSON mapping.

Failure #3: The User Lacks Permission to Create Records on the Custom Object

What you see: Salesforce returns a 403 Forbidden error, or an INSUFFICIENT_ACCESS error. The API call authenticated successfully but was rejected.

Why it happens: Creating a custom object does not automatically grant permission to write to it. As a Salesforce administrator, you can see the object in Setup. But API access requires explicit permission on the object and on every custom field you want to populate.

The fix:

Step 1: In Salesforce, navigate to Setup → Users → Profiles (or Permission Sets).

Step 2: Find the profile or permission set associated with the user whose credentials the plugin uses.

Step 3: Grant the following permissions:

  • Object Permissions: Create, Read, Edit on the custom object
  • Field-Level Security: Edit access on every custom field you are mapping

Step 4: Save the permissions. Wait a few minutes for Salesforce to propagate the changes.

How to verify: After updating permissions, submit a test form. A 201 response means the record was created.

Failure #4: The OAuth Token Does Not Have the Correct Scope

What you see: Salesforce returns a 401 Unauthorized error, or the token works for standard objects but fails for custom objects.

Why it happens: Salesforce OAuth tokens are scoped. The api scope grants access to standard objects, but custom objects may require additional permissions or a different scope configuration.

The "Contact Form to Any API" plugin's PRO version with the OAuth Add-on handles Salesforce's OAuth 2.0 flow, including automatic token refresh. If you are using the free version without the OAuth Add-on, token management may be incomplete.

The fix:

Step 1: Verify you are using the PRO version with the OAuth Add-on. The free version does not support automatic token renewal, which means expired tokens will cause failures.

Step 2: In the plugin's Auth Master settings, confirm the OAuth scopes include:

  • api (Access and manage your data)
  • refresh_token and offline_access (for automatic token refresh)

Step 3: Re-authorize the connection. In the plugin, click Authorize again to generate a fresh token with the correct scopes.

For a comprehensive breakdown of authentication errors across different APIs, see this guide on Contact Form 7 API authentication errors.

The Debugging Checklist

Step Action What It Reveals
1 Check plugin API Logs Was a request sent? What response code?
2 Verify endpoint URL ends with __c/ Custom object endpoint format
3 Verify field API names end with __c Field naming convention
4 Check user permissions on the object Object-level create/edit access
5 Check field-level security Edit access on each mapped field
6 Verify OAuth token scopes api, refresh_token, offline_access

Beyond Custom Objects: One Form, Multiple Destinations

Once your custom object integration works, you might want to send the same submission to other Salesforce objects or external tools.

A good connector plugin supports multiple API integrations from a single form submission. You can create a custom object record, a standard Lead, and send an SMS via Twilio, all from one CF7 submission. For a cost comparison, see this article on Zapier vs a dedicated API plugin.

Key Takeaways

Every custom object and custom field API name ends with __c. Omitting this suffix is the most common cause of INVALID_FIELD and 404 errors.

Creating the object does not grant write permission. You must explicitly grant Create/Edit permissions on the object and Edit access on every custom field.

The endpoint URL must target the custom object by its API name. /sobjects/Your_Object__c/ is the correct format.

OAuth scopes must include api and refresh capabilities. Without proper scopes, the token may work for standard objects but fail for custom ones.

Use the PRO version with the OAuth Add-on for Salesforce. The free version does not handle automatic token refresh, which is essential for long-term reliability.

With the correct __c suffixes, proper permissions, and valid OAuth scopes, your CF7-to-Salesforce custom object integration will create records reliably.

Top comments (0)