Concur Expense Sync
Setup
Prerequisites
- MuleSoft Direct setup is required. For more information, see the MuleSoft Direct setup guide.
- Obtain SAP Concur license and Concur client app credentials for establishing a connection to Concur via APIs. The Concur client app should have all required access such as read/write access to expenses, expense reports, attendees, users etc.
- Create an Integration User and ensure this user has read and write access to all mapped Expense entities and fields in Life Sciences Cloud.
- Create a custom permission set that uses the
Life Sciences Commercial licenseand grants access to all required entities and fields. - Create a second custom permission set that uses the
Salesforce API Integration license, and enable the following System Permissions:- Modify All Data
- Customize Application
- Skip Life Sciences Trigger Handlers
- Assign both custom permission sets and the
Life Sciences Field Medicalpermission set to the Integration User.
- Create a custom permission set that uses the
- To integrate the application with Life Sciences Cloud, set up a Local External Client App in your Salesforce org. When you configure the external client app, select
Run asas the Integration User created in previous step. You’ll need the credentials from this external app during the MuleSoft Direct setup. - Ensure that the ExpenseReport.ExpenseSystemIntegrationStatus and Expense.ExpenseSystemIntegrationStatus picklist values has these values added:
- Pending
- Completed
- Error
- Failure
- Deleted
- Ensure that the ExpenseReport.Status picklist values has these values added:
- NotSubmitted
- Submitted
- InReview
- Approved
- Rejected
- Deleted
- Ensure that the IntegrationJobRun.Status picklist values has these values added:
- InProgress
- Completed
- CompletedWithError
- Failure
- Enable Field-Level Security (FLS) for the integration user profile on all mapped fields. If you use the default field mappings, ensure FLS is enabled for the following fields:
- ExpenseReport
- Status
- ExpenseSystemIntegrationStatus
- ExpenseSystemIntegrationError
- SourceSystemName
- SourceSystemIdentifier
- Expense
- RelatedExpenseType
- SourceSystemName
- SourceSystemIdentifier
- Comments
- ExpenseSystemIntegrationStatus
- ExpenseSystem IntegrationError
- HealthcareProvider
- ExpenseSystemIdentifier
- ExpenseReport
Setup
- Log into Salesforce and navigate to the Setup page.
- Search for the
MuleSoft Directpage. - Select the
Concur Expense Syncapplication and clickEnable. - Enter the application display name, target business group, and environment for deployment, then click
Next. - Select the
Concur Expense Synctab and enter ‌these details to configure the application properties:
| Key name | Sample value | Description |
|---|---|---|
| Salesforce Host | test-instance.salesforce.com | Salesforce Life Sciences instance URL |
| Salesforce Consumer Key | - | Connected app Client ID to authenticate to Salesforce |
| Salesforce Consumer Secret | - | Connected app Client Secret to authenticate to Salesforce |
| Concur Host | us2.api.concursolutions.com | Concur API instance URL |
| Concur Consumer Key | - | Client Id to authenticate to Concur API |
| Concur Consumer Secret | - | Client Secret to authenticate to Concur API |
| Concur Refresh Token | - | A Onetime Refresh Token to get Access Token to authenticate to Concur API |
- To add any optional configuration, click
Add Additional Parametersand enter the required details. - Click
Proceedto deploy the application.
Post Deployment
- To enable/disable/modify the sync jobs (salesforce-to-concur-sync, concur-to-salesforce-sync) after deployment, follow below steps:
- Log in to Mulesoft Anypoint Platform.
- From the top right corner, select the Organization where the applications are deployed.
- In the Management Center, select Runtime Manager and choose the correct environment where the applications are deployed.
- Search for and select the Concur expense sync application which was deployed using MS Direct.
- Navigate to Schedules, select the jobs, and enable or disable or modify the schedule as required.
Customizations
Customizations can be done in the app by modifying the below mappings (in /resources/dwl/mapping folder):
fieldMapping.dwl
Contains functions for field value mappings between Salesforce and Concur.
| Function Name | Description |
|---|---|
| getExpenseType | Returns the ExpenseType field mapping between Salesforce and Concur. Key = Salesforce ExpenseType value, Value = Concur ExpenseType value. |
| getExpenseReportStatus | Returns the Expense Report Status field mapping between Salesforce and Concur. Key = Salesforce Status value, Value = Concur ApprovalStatusName value. |
| getExpenseReportStatusCode | Returns the Expense Report Status Code mapping between Salesforce and Concur. Key = Salesforce Status value, Value = Concur ApprovalStatusCode value. Controls which Concur reports are imported into Salesforce during Prerequisite Sync. |
Source:
./src/main/resources/dwl/mapping/fieldMapping.dwl
toConcur.dwl
Contains functions for transforming Salesforce data to Concur format (used in salesforce to concur job).
| Function Name | Description |
|---|---|
| getAttendee | Maps Salesforce participant data to Concur Attendee object. |
| getExpenseReport | Maps Salesforce ExpenseReport data to Concur expense report format. |
| getExpense | Maps Salesforce Expense data to Concur expense format. |
| getAttendeeAssociation | Maps Salesforce data to Concur attendee association format. |
Source:
./src/main/resources/dwl/mapping/toConcur.dwl
toSalesforce.dwl
Contains functions for transforming Concur data to Salesforce format (used in concur to salesforce job).
| Function Name | Description |
|---|---|
| getExpenseReport | Maps Concur expense report data to Salesforce ExpenseReport object. |
| getExpenseReportEntry | Maps Concur data to Salesforce ExpenseReportEntry object. |
| getExpense | Maps Concur expense data to Salesforce Expense object. |
Source:
./src/main/resources/dwl/mapping/toSalesforce.dwl
Limitations
- All users submitting expenses in Life Sciences Cloud must have a corresponding profile in Concur.
- Expense reports must be manually submitted to the approval workflow in Concur. The integration does not automatically submit records to the workflow.
- The Salesforce to Concur job must be executed before the Concur to Salesforce job.
- When race conditions occur between records in Salesforce and Concur, the record with the most recent timestamp takes precedence.
- Only one attachment is supported per expense.
- The maximum supported attachment size is 1000KB and supported attachment types are PNG, JPG, JPEG, and PDF.
- If an error or failure occurs while syncing expenses or reports, manual intervention is required to change the status to Pending so that the Salesforce to Concur job can process the record again.
- The following are not synced from Concur to Salesforce:
- New expenses created directly in Concur
- Receipts/Attachments
- Participants/Attendees
- Expense comments added or updated in Concur (due to a limitation of the Concur APIs)
- ExpenseType changes made in Concur
- The integration does not support creating new users in Concur or deleting/inactivating attendees and users in Concur.
- Editing Visit expenses is supported only via the mobile app. Changes made in the Salesforce web app, including updates to expense reports, expenses, participants, or attachment, will not sync to Concur. Use the mobile app or Concur directly to apply changes.
- Attendee duplicate detection logic must be managed in Concur.
- A default
Expense Payment Typemust be configured in Concur's policy management settings. - If Concur auto-allocates the total amount, company settings might have mandated equal allocation for specific expense types.
- To sync successfully, the same user must own both the expense report and its related expenses in Concur and Salesforce. If an expense owner differs from the parent expense report owner, the expense is not synced to Concur and Salesforce marks the expense as
Error; the expense report and other matching expenses sync as expected. - Admins can create expense reports on behalf of end users, and transfer ownership to the end user before syncing.
- Unsubmitted and rejected reports are inserted into Salesforce via the prerequisite sync in forward sync. They become eligible for forward sync or reverse sync updates.
- New expenses cannot be added to a rejected report through the integration. Although the Concur web application allows it, the Concur API rejects new expenses and updates to existing entries on such reports, so the expense is not synced and Salesforce marks the expense as
Error. - When an Expense is deleted in Concur, it is now only unlinked from Reports instead of being deleted in Salesforce, to help preserve history. Manually clean up these unlinked Expenses, as the Integration does not delete them automatically.
- Don't link one expense to more than one expense report.
- To move an expense from one report to another, move it in Concur. Don't move synced expenses between reports in Salesforce.
- By default, synchronization is restricted to 100 expenses per report. To process larger volumes, customize the integration to iteratively fetch subsequent records using the NextPage parameter provided in the Concur API payload.