Salesforce to Workday Financials Opportunity Broadcast

(0 reviews)

home

Broadcasts new Salesforce opportunities or updates to existing opportunities to Workday Financials in real time. The selection criteria and fields to integrate are configurable. Additional systems can be added to be notified of the changes.

Real time synchronization can be achieved either via rapid polling of Salesforce or Outbound Notifications to reduce the number of API calls. This template uses Mule batching and watermarking capabilities to capture only recent changes, and to efficiently process large numbers of records.

a69cef4f-cc1f-4fb3-bc83-7838cf689ee8-image.png

License Agreement

This template is subject to the conditions of the MuleSoft License Agreement. Review the terms of the license before downloading and using this template. You can use this template for free with the Mule Enterprise Edition, CloudHub, or as a trial in Anypoint Studio.

Use Case

As a Salesforce admin I want to synchronize opportunities at the Closed Won stage from a Salesforce Organization to a Workday instance.

Every time there is an opportunity set to the Closed Won stage, the integration polls for changes from the Salesforce source instance and updates the opportunity in the Workday target instance.

Requirements have been set not only to be used as examples, but also to establish a starting point to adapt your integration to your requirements.

Considerations

Note: This template illustrates the synchronization use case between SalesForce and Workday.
Before running this template:

  1. A Workday opportunity requires a reference to a customer. That is why Salesforce opportunities without an Account attribute, which is optional there, are filtered.
  2. A Salesforce account must have all address information data filled out. Furthermore, the template only makes use of following attribute and their values:

    • Country: United States, Canada
    • State: CA
    • Industry: Technology, Hospitality
    • Postal Code: a valid code from California, for example 90210.

Custom mappings need to be extended to cover other values.

  1. A Salesforce opportunity must have some products associated.
  2. An opportunity object needs to be extended in Salesforce by a new field called Workday_sync of Checkbox data type. It stores the flag if a record was synchronized by this integration process.

Salesforce Considerations

As a Data Source

If a user who configures the template for the source system does not have at least read only permissions for the fields that are fetched, then an InvalidFieldFault API fault displays.

java.lang.RuntimeException: [InvalidFieldFault [ApiQueryFault 
[ApiFault  exceptionCode='INVALID_FIELD'
exceptionMessage='Account.Phone, Account.Rating, Account.RecordTypeId, 
Account.ShippingCity
^
ERROR at Row:1:Column:486
No such column 'RecordTypeId' on entity 'Account'. If you are attempting to 
use a custom field, be sure to append the '__c' after the custom field name. 
Reference your WSDL or the describe call for the appropriate names.'
]
row='1'
column='486'
]
]

Workday Considerations

As a Data Destination

There are no considerations with using Workday as a data destination.

Workday Financials Considerations

As a Data Destination

There are no considerations with using Workday Financials as a data destination.

Run it!

Simple steps to get this template running.

Running On Premises

In this section we help you run this template on your computer.

Where to Download Anypoint Studio and the Mule Runtime

If you are new to Mule, download this software:

Note: Anypoint Studio requires JDK 8.

Importing a Template into Studio

In Studio, click the Exchange X icon in the upper left of the taskbar, log in with your Anypoint Platform credentials, search for the template, and click Open.

Running on Studio

After you import your template into Anypoint Studio, follow these steps to run it:

  1. Locate the properties file mule.dev.properties, in src/main/resources.
  2. Complete all the properties required per the examples in the "Properties to Configure" section.
  3. Right click the template project folder.
  4. Hover your mouse over Run as.
  5. Click Mule Application (configure).
  6. Inside the dialog, select Environment and set the variable mule.env to the value dev.
  7. Click Run.

Running on Mule Standalone

Update the properties in one of the property files, for example in mule.prod.properties, and run your app with a corresponding environment variable. In this example, use mule.env=prod.

Running on CloudHub

When creating your application in CloudHub, go to Runtime Manager > Manage Application > Properties to set the environment variables listed in "Properties to Configure" as well as the mule.env value.

Deploying a Template in CloudHub

In Studio, right click your project name in Package Explorer and select Anypoint Platform > Deploy on CloudHub.

Properties to Configure

To use this template, configure properties such as credentials, configurations, etc.) in the properties file or in CloudHub from Runtime Manager > Manage Application > Properties. The sections that follow list example values.

Application Configuration

  • page.size 100
  • scheduler.frequency 5000
  • scheduler.start.delay 0
  • watermark.default.expression 2018-01-02T15:53:00Z
Workday Connector Configuration
Salesforce Connector
  • sfdc.username user@company.com
  • sfdc.password secret
  • sfdc.securityToken h0fcC2Y7dnuH7ELk9BhoW0xu

API Calls

Salesforce imposes limits on the number of API calls that can be made. Therefore calculating this amount may be an important factor to consider. The template calls to the API can be calculated using the formula:

  • 1 + X + X / 200 -- Where X is the number of accounts to synchronize on each run.
  • Divide by 200 because by default, accounts are gathered in groups of 200 for each upsert API call in the commit step.

For instance if 10 records are fetched from origin instance, then 12 API calls are made (1 + 10 + 1).

Customize It!

This brief guide provides a high level understanding of how this template is built and how you can change it according to your needs. As Mule applications are based on XML files, this page describes the XML files used with this template. More files are available such as test classes and Mule application files, but to keep it simple, we focus on these XML files:

  • config.xml
  • businessLogic.xml
  • endpoints.xml
  • errorHandling.xml

config.xml

This file provides the configuration for connectors and configuration properties. Only change this file to make core changes to the connector processing logic. Otherwise, all parameters that can be modified should instead be in a properties file, which is the recommended place to make changes.

businessLogic.xml

This file holds the functional aspect of the template, directed by one flow responsible of conducting the business logic.

The functional aspect of this template is implemented in this XML file, directed by a flow that polls for Salesforce updates.
Several message processors constitute these high level actions that fully implement the logic of this template:

  1. The template queries all the existing opportunities that have been updated after watermark.
  2. During the Process stage, a Salesforce Account owning the processed Opportunity is used to create a Workday Customer.
  3. A Workday opportunity is created and a Salesforce opportunity is updated with a flag so it is not processed on the next run.
  4. During the On Complete stage the template logs output statistics data to the console.

endpoints.xml

This is file is conformed by a Flow containing the endpoints for triggering the template and retrieving the objects that meet the defined criteria in the query. And then executing the batch job process with the query results.

errorHandling.xml

This file handles how your integration reacts depending on the different exceptions. This file provides error handling that is referenced by the main flow in the business logic.


Reviews

TypeTemplate
OrganizationMuleSoft
Published by
MuleSoft Organization
Published onJul 16, 2019
Asset overview

Asset versions for 2.1.x

Asset versions
VersionActions
2.1.1
2.1.0

Categories

Pattern
BroadcastNo values left to add
Functions
FinanceEnterprise ITSalesNo values left to add
Object
OpportunityNo values left to add
Products
SalesforceWorkdayNo values left to add

Tags