Salesforce to Workday Financials Account - Customer Broadcast

(0 reviews)

home

Broadcast new accounts or update existing accounts in Salesforce to Workday Financials as customers in real time. Ensure that the customer (account) information in the Workday Financials module is updated to Salesforce changes.

The detection criteria and fields to integrate are configurable. Add systems to be notified of changes. Real time synchronization is achieved using rapid polling of Salesforce or outbound notifications to reduce the number of API calls. This template uses Mule batch processing and watermarking to efficiently process large numbers of records.

8a22b5e1-d19d-45ca-b26e-385480c26730-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

Synchronize accounts and customers between Salesforce and Workday.

This template is for setting an online sync of accounts from Salesforce instance to a customer in a Workday instance. Each time there is a new account or a change in an existing one with a type stating the string customer, the integration polls for changes in the Salesforce source instance and updates the customer in the target Workday instance. You can use this template as an example and to establish a starting point to adapt your integration to your requirements.

This template leverages the Mule batch module. The integration is triggered by a scheduler defined in the flow that triggers the application, queries the newest Salesforce updates or creates matching a filter criteria and executes the batch job. During the Process stage, each Salesforce account is checked, if it has an existing matching customer in the Workday instance. The last step of the Process stage inserts or updates the customers in Workday. Finally during the On Complete stage the template logs output statistics data to the console.

Considerations

To make this template run, there are certain preconditions that must be considered. All of them deal with the preparations in both source (Salesforce) and destination (Workday) systems, that must be made for the template to run smoothly. Failing to do so can lead to unexpected behavior of the template.

This template illustrates the broadcast use case between Salesforce and a Workday, thus it requires a Workday instance to work.

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

  • When creating new Workday customer, one of existing customer categories must be chosen. To do this, this template uses a lookup table with predefined mappings between the Salesforce data (Industry) and the Workday Customer Category ID.
  • Workday customer categories can be user defined, therefore the mapping must be edited by user manually before running this template.
  • To view all the Workday Customer Categories, type "customer categories" in the search field in Workday and select the Customer Categories report. In the report you should see all the customer categories available. Select Integration IDs > View Integration IDs from available actions of each customer category and update the function industryToCustomerCategoryMapping in the template's DataWeave component 'Prepare put customer request' manually.
  • The default customer category ID can be edited inside the same DataWeave component in the row where a customer category ID is set. This category is used if the source account's industry value does not match any defined mappings in the function.

Run it!

Simple steps to get this template running.

See below.

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.

While creating your application on CloudHub (or you can do it later as a next step), you need to go to Deployment > Advanced to set all environment variables detailed in Properties to Configure as well as the mule.env.
Every time an account (with type starting with customer) is created or modified, it automatically synchronizes to the Workday instance.

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

Application Configuration

  • scheduler.frequency= 60000
  • scheduler.start.delay= 500
  • watermark.default.expression (now() - |PT5M|) as String or 2018-01-02T15:53:00Z

Salesforce Connector Configuration

  • sfdc.username joan.baez@orgb
  • sfdc.password JoanBaez456
  • sfdc.securityToken ces56arl7apQs56XTddf34X

Workday Connector Configuration

  • wdayf.username joan
  • wdayf.tenant acme_pt1
  • wdayf.password joanPass123
  • wdayf.host your_impl-cc.workday.com

  • wdayf.country USA

  • wdayf.state USA-CA
  • wdayf.postalCode 90001
  • wdayf.city San Francisco
  • wdayf.street Main Street 123
  • wdayf.phone 123-4567

API Calls

Salesforce imposes limits on the number of API calls that can be made. However, we make API call to Salesforce only once during migration, so this is not something to worry about.

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

The functional aspect of this template is implemented in this XML file directed by oane flow that polls for Salesforce creates or updates. The several message processors constitute four high level actions that fully implement the logic of this Template:

  1. In Salesforce query all existing accounts that match the filter criteria.
  2. During the Process stage, check each Salesforce account ID in the external ID field in Workday (Customer_Reference_ID), to see if it has existing matching objects in Workday.
  3. Upsert of the relevant Customer fields is performed in Workday
  4. During the On Complete stage log output statistics data to the console.

endpoints.xml

This file is created by a flow containing the Scheduler that periodically queries Salesforce for updated or created Accounts that meet the defined criteria in the query and then executes 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
Object
AccountNo values left to add
Functions
Enterprise ITFinanceSalesNo values left to add
Products
SalesforceWorkdayNo values left to add

Tags