This article explains how to show Salesforce records on WordPress.
We will retrieve a list of records from a Custom object Sessions and display the same on a WordPress page. Sessions object is a list of training events, dates and levels. You can use the plugin to display any Standard or Custom object.
The first step is to make sure you have the connection setup between your Salesforce instance and WordPress using Sawfish plugin.
Follow the instructions here: Install and Setup Sawfish Salesforce Integration Plugin for WordPress
We will add a calendar on a WordPress page that shows the list of upcoming sessions. This will use the Calendar view option on the plugin, the same steps can be followed to show Tables and Cards as well.
From your WordPress Dashboard select Sawfish Connect, Click on Add Cards & Tables.
If you don’t have the Sawfish Connect menu option, you may need to download and install.
In the Select Object option you can see the objects that we can get from your connected Salesforce instance. For our events page I’m going to select the Sessions custom object, you can select any of the standard and custom objects on your Salesforce instance.
In the Select Fields to Display option lets us choose the field to show as the Event Name and the time of the event. I have selected Session Name and Session Date.
The number of records option lets you select the number of records, in our case events to retrieve from Salesforce. I have selected 20. In Show Records as option select Calendar
We can use the Category field to filter events displayed on our Calendar. I have selected Level this would let us show Beginner, Professional, Advanced etc. sessions separately.
Finally, rearrange the fields to let the plugin know info to be used for Event Name and Date. Move the field used in for Event Name (Session Name) in the first position and Event Date (Session Date) field as the second.
All done! Now we can copy and paste the code to our WordPress Pages and Posts to show our Calendar. Click to copy the code in blue text.
Form the WordPress Dashboard, click Add New from Pages. You can display the records on Posts, Widgets and other Website sections as well.
Click the Publish button to view the Page. Click view page to see the page we created.
We can now filter the events based on selected Level using the drop down!
Let’s see how real time updates to date happen. Back in Salesforce our instructor wants the Gardening session to be called Landscaping instead.
After saving the change to the Session name on Salesforce, just refresh the new page on WordPress.
There’s the updated event name! The pages now show real time data from Salesforce. You never have to worry about having to copy paste anything from Salesforce and WordPress or update numerous event plugins.