This post will explain steps to send form information from WordPress to Salesforce.
-
- The first step is to the download the HTML Forms plugin. This is simple plugin that will let you easily create and manage forms.
- The Sawfish plugin would let you to both create and update records on WordPress.
- In the form we mention a few additional fields in order to connect to the correct object in Salesforce. The updating a record the Id of the record should be included as well.
- After installing the HTML Forms plugin, navigate to the plugin screen from the WordPress dashboard.
- Click Add New Form. To set values, in Salesforce the field API names should match the name parameter of each field in the form.
- Along with the set fields, include the following fields as hidden fields.
- i) sf-o for the object you’d like to connect to
ii) sf-form for the type of form. Here, set it to create or update.
iii)sf-nameoffield for the type of form. Where nameoffield is the API name of the field name. Eg: sf-Email__c
- i) sf-o for the object you’d like to connect to
- Here’s a simple form to create a Contact record on Salesforce.
<input type="hidden" name="sf-o" value="Contact" /> <input type="hidden" name="sf-form" value="create" /> <p> <label>Your First Name</label> <input type="text" name="sf-FirstName" placeholder="Your First Name" required /> </p> <p> <label>Your Last Name</label> <input type="text" name="sf-LastName" placeholder="Your Last Name" required /> </p> <p> <input type="submit" value="Send" /> </p>
- Similar format can be followed for updating a record on Salesforce. Add another hidden field : sf-Id so that the correct record can be updated in Salesforce.
<p> <label>Record Id</label> <input type="text" name="sf-Id" placeholder="Record Id" value="0030K00002XNdFL" /> </p>
- That’s it! Now, add the form to a Page or a Post in WordPress and check out the record in Salesforce.