WorkMarket's Professional Services team can help you integrate your Salesforce instance with the WorkMarket platform. Contact us at email@example.com.
This sample integration demonstrates creating an assignment in WorkMarket from a corresponding object in Salesforce, including pricing, location, scheduling, and custom field information.
Salesforce Integration Video
There is a video on our product video site that highlights the WorkMarket integration with Salesforce.
Setting this demo up in your salesforce environment requires a few customizations in the following areas:
- Custom Labels for environment-specific constants
- Custom object to represent a WorkMarket Assignment in SF
- The Apex classes and trigger included in this repo
Follow the instructions below to get started.
This relies on Custom Labels for storing certain constants related to the integration. You will need to create the following Custom Labels in your SF instance:
Email to receive error messages
WM API token (not access token)
WM API secret
The base URL of the WM environment you are use
ID of your default custom fields group in WM
ID of the Salesforce Object ID field in your custom field group.
For this sample code, we have created a custom Assignment object that represents a WM assignment. You could pull these fields from a customized Case, Opportunity, or whatever you prefer to use. You'll want to create a layout for this object as well to make it usable.
Assign By Email
Text(12) (External ID) (Unique Case Insensitive)
Custom Field 1
Long Text Area(32768)
End Time (Site Local)
Max Hours @ Secondary Rate
Picklist ("Flat Rate", "Hourly", "Dual Rate Hourly", "Per Unit")
Skills & Specialties
Long Text Area(32768)
Start Time (Site Local)
State / Province / Region
Picklist ("Draft", "Published to WorkMarket")
View in WorkMarket
Formula (Text) "$Label.WM_URL & '/assignments/details/' & Assignment_ID__c"
WorkMarket has a certified MuleSoft Connector which can make integrating with your workflows a breeze. Learn more.
For this sample integration, you'll need 4 Apex classes and 1 trigger class. You can get the source code from our public GitHub repository listed below.
Now that you've added the required Custom Labels, created the Assignment custom object, and added the Apex classes & trigger, let's bring it all together.
Create a new Assignment object and enter (at least) the following fields:
- Start date / time
- Location Address fields (Address 1, Address 2, City, State, Postal Code, Country)
- Pricing Type
- Max Hours/Units (if "Hourly", "Unit", or "Dual Rate Hourly" selected)
- Max Hours @ Secondary Rate (if "Dual Rate Hourly" selected)
Set the Status field to "Draft" and Save.
Change the status to "Published to WorkMarket" and Save.
Wait a few seconds and refresh the Assignment details page. If you see a number in the Assignment ID field, it worked! Click the "View In WorkMarket" link to see it.