---
schema_version: "1"
id: da63f054885c076a44bafc360bd39eca7b94fcb304a41a63b80db0458120258a
title: Salesforce Financial Services Cloud Setup Guide
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/financial-services/latest/sfdc-fsc-setup-guide.md
canonical_url: https://docs.mulesoft.com/financial-services/latest/sfdc-fsc-setup-guide
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 206f69efb5aa82cf1264ea19b45aee1583d873dd21aadb01dd93e655b2a501c4
description: MuleSoft Documentation Site
release: "1.12"
latest: true
---
---
product: Financial Services
version: 1.12
is-latest-version: true
---

# Salesforce Financial Services Cloud Setup Guide

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

This page describes how to configure an existing Salesforce Financial Services Cloud (FSC) instance
to support the default MuleSoft Accelerator for Financial Services functionality. These instructions
assume that the required FSC packages have been deployed to the target Salesforce instance and that
the appropriate permissions have already been assigned.

## Record Types

The following record types must exist in the corresponding objects for the accelerator assets to
function correctly.

<table><colgroup><col> <col></colgroup><thead><tr><th>Salesforce Object</th><th>Record Type</th></tr></thead><tbody><tr><td><p>Account</p></td><td><p>Household</p></td></tr><tr><td><p>Financial Account</p></td><td><p>Blockchain Account</p></td></tr><tr><td><p>Financial Account</p></td><td><p>General Ledger Account</p></td></tr><tr><td><p>Financial Account</p></td><td><p>Money Market Account</p></td></tr><tr><td><p>Financial Account Transaction</p></td><td><p>Financial Account Transfer Transaction</p></td></tr><tr><td><p>Lead</p></td><td><p>Lead</p></td></tr></tbody></table>

Follow the instructions for each object below.

### Account & Lead

To enable the `Household` record type in `Account` object, follow the below steps:

1.  Click the Salesforce Setup icon.

2.  Navigate to `Users -> Profiles`.

3.  Select the target profile for the service account user.

4.  Navigate to `Object Settings -> Accounts` and click the **Edit** button.

5.  Under `Record Types and Page Layout Assignments` check the `Household` record type.

6.  Click the **Save** button.

Follow the same steps but this time enable the `Lead` record type on the `Lead` object.

### Financial Account

To create the `Blockchain Account` record type in the Financial Account object, first create a page
layout for it based on an existing layout.

1.  Select the `Object Manager` tab from the Setup home page.

2.  Select the `FinServ_FinancialAccount__c` object.

3.  Select `Page Layouts` from the left nav and click **New**.

4.  Select an existing page layout (for example, "Financial Account (Savings Account) Layout").

5.  Set the `Page Layout Name` field to "Financial Account (Blockchain Account) Layout".

6.  Click **Save** to create the new layout.

Select `Page Layouts` from the left nav to return to the list and repeat the above steps to create
the `General Ledger Account` and `Money Market Account` page layouts.

Now create the new `Blockchain Account` record type:

1.  Select `Record Type` from the left nav and click **New**.

2.  Select an existing record type (for example, "Savings Account").

3.  Fill out the following fields as indicated.

    - `Record Type Label` -> "Blockchain Account"

    - `Record Type Name` -> "Blockchain" (change default value).

    - `Description` -> "Represents a Blockchain account"

4.  Enable the `Active` checkbox.

5.  In the list of profiles, check the `Make available` option the profile assigned to the target
    API service account (at a minimum).

6.  Click **Next** and select the option `Apply one layout to all profiles`.

7.  Select the page layout "Financial Account (Blockchain Account) Layout".

8.  Click **Save**.

Repeat the above steps to create the `General Ledger Account` and `Money Market Account` record
types. Be sure to select the correct page layout corresponding to the record type.

The new record types should now be available in the `Record Types` section. You can verify that the
new record type is also available to the target user profile as follows:

1.  Navigate to `Users -> Profiles`.

2.  Select the target profile.

3.  Navigate to `Object Settings -> Financial Accounts` (the object you edited earlier) and click
    the **Edit** link.

4.  Verify that the new record types are listed under `Record Types and Page Layout Assignments`.

### Financial Account Transaction

The standard record type **Financial Account Transaction** supports the transaction types
`DebitTransaction` and `CreditTranction`. The **Financial Account Transfer Transaction** record type
must be created to support the `TransferTransaction` and `PaymentTransaction` transaction types.

The steps for creating the `Financial Account Transfer Transaction` record type are similar to those
above, but for the `Financial Transaction` object instead.

1.  In the Object Manager, select the `FinServ_FinancialAccountTransaction__c` object.

2.  Select `Page Layouts` from the left nav and click **New**.

3.  Select an existing page layout (for example, "Financial Account Transaction Layout").

4.  Set the `Page Layout Name` field to "Financial Account Transfer Transaction Layout".

5.  Click **Save**.

6.  Select `Record Types` from the left nav and click **New**.

7.  Select an existing record type (for example, "Financial Account Transaction") if available,
    otherwise use "--Master--".

8.  Fill out the following fields as indicated.

    - `Record Type Label` -> "Financial Account Transfer Transaction".

    - `Record Type Name` -> "Financial\_Account\_Transfer" (change default value).

    - `Description` -> "Defines a transaction that represents a generic transfer from one account to
      another".

9.  Enable the `Active` checkbox.

10. In the list of profiles, check the `Make available` option the profile assigned to the target
    API service account (at a minimum).

11. Click **Next** and select the option `Apply one layout to all profiles`.

12. Select the page layout "Financial Account Transfer Transaction Layout".

13. Click **Save**.

The new record type can be verified as above.

## Custom Fields

The following fields must be created in the corresponding objects.

<table><colgroup><col> <col> <col> <col> <col> <col> <col></colgroup><thead><tr><th>Salesforce Object</th><th>Field Label</th><th>Field Name</th><th>Data Type</th><th>Length</th><th>Unique*</th><th>ExternalId</th></tr></thead><tbody><tr><td><p>Account</p></td><td><p>Global Billing Address ID</p></td><td><p>Global_BillingAddress_Id</p></td><td><p>Text</p></td><td><p>36</p></td><td><p>Y</p></td><td><p>Y</p></td></tr><tr><td><p>Account</p></td><td><p>Global Customer ID</p></td><td><p>Global_Customer_Id</p></td><td><p>Text</p></td><td><p>36</p></td><td><p>Y</p></td><td><p>Y</p></td></tr><tr><td><p>Account</p></td><td><p>Global Email Address ID</p></td><td><p>Global_EmailAddress_Id</p></td><td><p>Text</p></td><td><p>36</p></td><td><p>Y</p></td><td><p>Y</p></td></tr><tr><td><p>Account</p></td><td><p>Global Fax Number ID</p></td><td><p>Global_FaxNumber_Id</p></td><td><p>Text</p></td><td><p>36</p></td><td><p>Y</p></td><td><p>Y</p></td></tr><tr><td><p>Account</p></td><td><p>Global Mailing Address ID</p></td><td><p>Global_MailingAddress_Id</p></td><td><p>Text</p></td><td><p>36</p></td><td><p>Y</p></td><td><p>Y</p></td></tr><tr><td><p>Account</p></td><td><p>Global Mobile Number ID</p></td><td><p>Global_MobileNumber_Id</p></td><td><p>Text</p></td><td><p>36</p></td><td><p>Y</p></td><td><p>Y</p></td></tr><tr><td><p>Account</p></td><td><p>Global Party ID</p></td><td><p>Global_Party_Id</p></td><td><p>Text</p></td><td><p>36</p></td><td><p>Y</p></td><td><p>Y</p></td></tr><tr><td><p>Account</p></td><td><p>Global Phone Number ID</p></td><td><p>Global_PhoneNumber_Id</p></td><td><p>Text</p></td><td><p>36</p></td><td><p>Y</p></td><td><p>Y</p></td></tr><tr><td><p>Account</p></td><td><p>Global Shipping Address ID</p></td><td><p>Global_ShippingAddress_Id</p></td><td><p>Text</p></td><td><p>36</p></td><td><p>Y</p></td><td><p>Y</p></td></tr><tr><td><p>Account</p></td><td><p>Customer Status</p></td><td><p>Customer_Status</p></td><td><p>Picklist</p></td><td><p>-</p></td><td><p>N</p></td><td><p>N</p></td></tr><tr><td><p>Contact</p></td><td><p>Global Email Address ID</p></td><td><p>Global_EmailAddress_Id</p></td><td><p>Text</p></td><td><p>36</p></td><td><p>Y</p></td><td><p>Y</p></td></tr><tr><td><p>Contact</p></td><td><p>Global Individual ID</p></td><td><p>Global_Individual_Id</p></td><td><p>Text</p></td><td><p>36</p></td><td><p>Y</p></td><td><p>Y</p></td></tr><tr><td><p>Contact</p></td><td><p>Global Phone Number ID</p></td><td><p>Global_PhoneNumber_Id</p></td><td><p>Text</p></td><td><p>36</p></td><td><p>Y</p></td><td><p>Y</p></td></tr><tr><td><p>Contact</p></td><td><p>Global Mobile Number ID</p></td><td><p>Global_MobileNumber_Id</p></td><td><p>Text</p></td><td><p>36</p></td><td><p>Y</p></td><td><p>Y</p></td></tr><tr><td><p>Contact</p></td><td><p>Global Other Address ID</p></td><td><p>Global_OtherAddress_Id</p></td><td><p>Text</p></td><td><p>36</p></td><td><p>Y</p></td><td><p>Y</p></td></tr><tr><td><p>Contact</p></td><td><p>Global Mailing Address ID</p></td><td><p>Global_MailingAddress_Id</p></td><td><p>Text</p></td><td><p>36</p></td><td><p>Y</p></td><td><p>Y</p></td></tr><tr><td><p>FinServ_Card__c</p></td><td><p>Card Type</p></td><td><p>Card_Type</p></td><td><p>Picklist</p></td><td><p>-</p></td><td><p>N</p></td><td><p>N</p></td></tr><tr><td><p>FinServ_Card__c</p></td><td><p>Cardholder Name</p></td><td><p>Cardholder_Name__c</p></td><td><p>Text</p></td><td><p>100</p></td><td><p>N</p></td><td><p>N</p></td></tr><tr><td><p>FinServ_Card__c</p></td><td><p>Credit Card Type</p></td><td><p>Credit_Card_Type__c</p></td><td><p>Picklist</p></td><td><p>-</p></td><td><p>N</p></td><td><p>N</p></td></tr><tr><td><p>FinServ_Card__c</p></td><td><p>Global Card ID</p></td><td><p>Global_Card_Id__c</p></td><td><p>Text</p></td><td><p>36</p></td><td><p>Y</p></td><td><p>Y</p></td></tr><tr><td><p>FinServ_FinancialAccount__c</p></td><td><p>Global Account ID</p></td><td><p>Global_Account_Id__c</p></td><td><p>Text</p></td><td><p>36</p></td><td><p>Y</p></td><td><p>Y</p></td></tr><tr><td><p>FinServ_FinancialAccount__c</p></td><td><p>Initial Transaction ID</p></td><td><p>Initial_Transaction_Id__c</p></td><td><p>Text</p></td><td><p>36</p></td><td><p>N</p></td><td><p>N</p></td></tr><tr><td><p>FinServ_FinancialAccount__c</p></td><td><p>Last Payment Amount</p></td><td><p>LastPaymentAmount__c</p></td><td><p>Currency</p></td><td><p>(16,2)</p></td><td><p>N</p></td><td><p>N</p></td></tr><tr><td><p>FinServ_FinancialAccount__c</p></td><td><p>Last Payment Date</p></td><td><p>LastPaymentDate__c</p></td><td><p>Date</p></td><td><p>-</p></td><td><p>N</p></td><td><p>N</p></td></tr><tr><td><p>FinServ_FinancialAccount__c</p></td><td><p>Last Statement Date</p></td><td><p>LastStatementDate__c</p></td><td><p>Date</p></td><td><p>-</p></td><td><p>N</p></td><td><p>N</p></td></tr><tr><td><p>FinServ_FinancialAccount__c</p></td><td><p>Last Transaction Amount</p></td><td><p>LastTransactionAmount__c</p></td><td><p>Currency</p></td><td><p>(16,2)</p></td><td><p>N</p></td><td><p>N</p></td></tr><tr><td><p>FinServ_FinancialAccount__c</p></td><td><p>Last Transaction Type</p></td><td><p>LastTransactionType__c</p></td><td><p>Picklist</p></td><td><p>-</p></td><td><p>N</p></td><td><p>N</p></td></tr><tr><td><p>FinServ_FinancialAccount__c</p></td><td><p>Last Transaction ID</p></td><td><p>Last_Transaction_Id__c</p></td><td><p>Text</p></td><td><p>36</p></td><td><p>N</p></td><td><p>N</p></td></tr><tr><td><p>FinServ_FinancialAccount__c</p></td><td><p>Maximum Monthly Withdrawals</p></td><td><p>Maximum_Monthly_Withdrawals__c</p></td><td><p>Number</p></td><td><p>18</p></td><td><p>N</p></td><td><p>N</p></td></tr><tr><td><p>FinServ_FinancialAccount__c</p></td><td><p>Monthly Withdrawal Limit</p></td><td><p>Monthly_Withdrawal_Limit__c</p></td><td><p>Number</p></td><td><p>(16,2)</p></td><td><p>N</p></td><td><p>N</p></td></tr><tr><td><p>FinServ_FinancialAccountTransaction__c</p></td><td><p>Debit Financial Account</p></td><td><p>Debit_Financial_Account__c</p></td><td><p>Lookup</p></td><td><p>-</p></td><td><p>-</p></td><td><p>-</p></td></tr><tr><td><p>FinServ_FinancialAccountTransaction__c</p></td><td><p>Credit Financial Account</p></td><td><p>Credit_Financial_Account__c</p></td><td><p>Lookup</p></td><td><p>-</p></td><td><p>-</p></td><td><p>-</p></td></tr><tr><td><p>FinServ_FinancialAccountTransaction__c</p></td><td><p>Global Transaction ID</p></td><td><p>Global_Transaction_Id__c</p></td><td><p>Text</p></td><td><p>36</p></td><td><p>Y</p></td><td><p>Y</p></td></tr><tr><td><p>FinServ_FinancialAccountTransaction__c</p></td><td><p>Originator ID</p></td><td><p>Originator_Id__c</p></td><td><p>Text</p></td><td><p>36</p></td><td><p>Y</p></td><td><p>N</p></td></tr><tr><td><p>InsurancePolicy</p></td><td><p>Global Policy ID</p></td><td><p>Global_Policy_Id__c</p></td><td><p>Text</p></td><td><p>36</p></td><td><p>Y</p></td><td><p>Y</p></td></tr><tr><td><p>Opportunity</p></td><td><p>ACH Transfer Authorization Document ID</p></td><td><p>Ach_Transfer_Auth_Document_Id</p></td><td><p>Text</p></td><td><p>36</p></td><td><p>N</p></td><td><p>N</p></td></tr><tr><td><p>Opportunity</p></td><td><p>Asset Transfer Authorization Document ID</p></td><td><p>Asset_Transfer_Auth_Document_Id</p></td><td><p>Text</p></td><td><p>36</p></td><td><p>N</p></td><td><p>N</p></td></tr><tr><td><p>Opportunity</p></td><td><p>Document Signatures Received</p></td><td><p>Document_Signatures_Received__c</p></td><td><p>Checkbox</p></td><td><p>-</p></td><td><p>-</p></td><td><p>-</p></td></tr><tr><td><p>Opportunity</p></td><td><p>KYC Completed</p></td><td><p>KYC_Completed__c</p></td><td><p>Checkbox</p></td><td><p>-</p></td><td><p>-</p></td><td><p>-</p></td></tr></tbody></table>

\*Unique fields should be case-sensitive

### Create via Apex Script

An Apex class called `CustomFieldUtility` can be used to create custom fields programmatically. The
source for this class can be found in the
[FINS Common Resources](https://anypoint.mulesoft.com/exchange/org.mule.examples/fins-common-resources-src)
project. Download this project and follow the steps below.

1.  Click on Salesforce Setup icon and select `Developer Console` to open a new console window

2.  Go to `File -> New -> Apex class` and create a new class named `CustomFieldUtility`

3.  Copy the code from `fins-common-resources/salesforce/CustomFieldUtility.apxc` to the script
    editor

4.  Select the `File -> Save` menu option to compile and save the class

5.  Select `Debug -> Open Execute Anonymous Window`

6.  Copy and paste the contents of `fins-common-resources/salesforce/CreateCustomFields.txt` into
    the window.

7.  Enable the `Open Log` option and click the **Execute** button.

Once the script completes, select the `Debug Only` filter option to show just the results of each
create request. Verify that all fields have been successfully created.

### Create Manually via Salesforce

To create each of these custom fields and enable visibility for them on page layouts:

1.  Click the Salesforce Setup icon.

2.  Select the `Object Manager` tab from the Setup home page.

3.  Find and select the target Salesforce object.

4.  Select the `Fields & Relationships` page.

5.  Click the **New** button and create the field as specified above.

6.  Once the field has been created, click the `Set Field-Level Security` button (or do these steps
    later - see below).

7.  Enable for desired profile, or tick the checkbox next to `Visible` to enable visibility for the
    desired profile(s).

Repeat these steps for each custom field in the above list.

> [!TIP] Instead of adjusting permissions for each field as you go, if you are only making them
> available to one or two profiles it may be more efficient to go to the
> `Users -> Profiles -> {profile} -> Object Settings` for each object and adjust the permissions for
> multiple fields at once.

### Additional Notes

- The **Card Type** picklist values are **DebitCard** and **CreditCard**.

- The **Credit Card Type** picklist values are **Amex**, **Discover**, **Mastercard**, **Visa**, and
  **Other**.

- The **Last Transaction Type** picklist values are **CreditTransaction**, **DebitTransaction**,
  **TransferTransaction**, and **PaymentTransaction**.

- The **Customer Status** picklist values are **Prospect**, **Onboarding**, **Active**,
  **Inactive**, **Closed**, **Deceased**, **Delinquent**, and **Dormant**.

- The **Debit Financial Account** and **Credit Financial Account** fields looks up respective
  Financial Accounts.

- All `Global_*_Id__c` fields should be visible in layouts (as described above) but made
  **read-only** to avoid issues with data synchronization.

## Enable Financial Accounts in Sales

When the Financial Services Cloud feature is added to the Salesforce instance, the Commercial and
Retail Banking apps are provided to work with financial accounts. If you want to enable the
Financial Accounts tab on the Sales app, follow these steps:

1.  Navigate to the `Sales` app home page.

2.  Click the pencil icon on the right corner of the navigation pane, which opens the
    `Edit Sales App Navigation Items` dialog box.

3.  Click **Add More Items**.

4.  Navigate to `All` under the `Available Items` menu.

5.  Search for `Financial Accounts` and Select it.

6.  Click `Add 1 Nav Item` and then click **Save**.

## Enable Transaction Status

The default implementation of the solution requires the enablement of additional values for the
transaction status picklist in the target FSC instance. This can be done as follows:

1.  Click the Salesforce Setup icon.

2.  Select the `Object Manager` tab from the Setup home page.

3.  Find and select the `FinServ_FinancialAccountTransaction_c` Salesforce object.

4.  Navigate to `Fields and Relationships` and select the `FinServ_TransactionStatus_c` picklist
    field.

5.  Scroll down to the `Values` section and click **New**.

6.  Enter the values for `Cancelled` and `Initial` on separate lines and click **Save**.

## Enable Transaction Types

The default implementation of the solution also requires the enablement of additional transaction
types. The steps are similar to those above:

1.  Click the Salesforce Setup icon.

2.  Select the `Object Manager` tab from the Setup home page.

3.  Find and select the `FinServ_FinancialAccountTransaction__c` Salesforce object.

4.  Navigate to `Fields and Relationships` and select the `FinServ_TransactionType__c` picklist
    field.

5.  Scroll down to the `Values` section and click **New**.

6.  Enter the values for `Payment` and `Transfer` on separate lines and click **Save**.

## Workflow Rules

To display a specific page layout based on the record type, a Workflow rule is created. To ensure
the page layout changes based on the record type `Financial Account Transfer Transaction`, follow
the below steps:

1.  Click the Salesforce Setup icon.

2.  Navigate to `Process Automation -> Workflow Rules`.

3.  Click the **New Rule** button.

4.  Select `FinServ_FinancialAccountTransaction__c` from the **Object** dropdown.

5.  Enter **Rule Name** as `Transfer Transaction Type` and description as
    `Defines a transaction that represents a generic transfer from one account to another`.

6.  Set `Evaluation Criteria` as `created, and any time it`s edited to subsequently meet criteria\`.

7.  In the `Rule Criteria` section, select `criteria are met`.

8.  In the first row, select the field as `Financial Account Transaction: Transaction Type`,
    operator as `equals`, and value as `Transfer`.

9.  In the second row, select the field as `Financial Account Transaction: Transaction Type`,
    operator as `equals`, and value as `Payment`.

10. Set filter logic `1 OR 2`. Click **Save**.

11. In `Workflow Actions`, under `Immediate Actions`, select `New Field Update`.

12. Set `Name` as `Transfer Transaction Type`.

13. In `Field to Update`, select `Record Type`. Click **Next**.

14. In `Specify New Field Value`, select `Financial Account Transfer Transaction` from the record
    type dropdown.

15. Click **Save**.

## Enable Multiple Currencies

The default implementation of the solution requires the enablement of multiple currency support in
the target FSC instance. This can be done as follows:

1.  Click the Salesforce Setup icon.

2.  Navigate to `Company Settings -> Company Information`.

3.  Click **Edit** and enable the `Activate Multiple Currencies` option.

4.  Click **Save**.

If desired, click the **Currency Setup** button to add support for additional currency codes (for
example, EUR).

## Create Platform Events and Apex Triggers

The following Platform Event Objects and Apex Triggers must be created in order to capture updates
from Salesforce. The scripts to create these Apex Triggers and add fields to Platform Event Objects
are located in the
[FINS Common Resources](https://anypoint.mulesoft.com/exchange/org.mule.examples/fins-common-resources-src/)
project.

<table><colgroup><col> <col> <col> <col></colgroup><thead><tr><th>Salesforce Object</th><th>Salesforce Platform Event Object</th><th>Salesforce Platform Event API Name</th><th>Apex Trigger Name</th></tr></thead><tbody><tr><td><p>Account</p></td><td><p>Account</p></td><td><p>Account__e</p></td><td><p>AccountEventsPub</p></td></tr><tr><td><p>Contact</p></td><td><p>Contact</p></td><td><p>Contact__e</p></td><td><p>ContactEventsPub</p></td></tr><tr><td><p>Account</p></td><td><p>AccountAddresses</p></td><td><p>AccountAddresses__e</p></td><td><p>AccountAddressEventsPub</p></td></tr><tr><td><p>Account</p></td><td><p>Household</p></td><td><p>Household__e</p></td><td><p>HouseholdEventsPub</p></td></tr><tr><td><p>Lead</p></td><td><p>Lead</p></td><td><p>Lead__e</p></td><td><p>LeadEventsPub</p></td></tr><tr><td><p>Opportunity</p></td><td><p>Opportunity</p></td><td><p>Opportunity__e</p></td><td><p>OpportunityEventsPub</p></td></tr><tr><td><p>FinServ_FinancialAccount__c</p></td><td><p>FinancialAccount</p></td><td><p>FinancialAccount__e</p></td><td><p>FinancialAccountEventsPub</p></td></tr><tr><td><p>FinServ_FinancialAccountTransaction__c</p></td><td><p>FinancialAccountTransaction</p></td><td><p>FinancialAccountTransaction__e</p></td><td><p>TransactionsEventsPub</p></td></tr><tr><td><p>FinServ_Card__c</p></td><td><p>FinancialCard</p></td><td><p>FinancialCard__e</p></td><td><p>CardsEventsPub</p></td></tr></tbody></table>

### Create Platform Event Object

This implementation requires creation of Platform Events in Salesforce. To create a Platform Event
Object following the below steps:

1.  Login to Salesforce.

2.  Click Setup to search for Platform Events in Quick Find Box. Platform Events Page under
    Integrations section appears with list of available Platform Events.

3.  Click **New Platform Event** button to create an Object and enter Platform Information Details
    fields like Label, Plural Label and Object with Object Name and Event API Names as above table.
    Click Save. Repeat this step for creating multiple Salesforce Platform Event Objects as
    mentioned in the above table.

4.  To add Custom Fields & Relationships to Platform Event Definitions, run the utility scripts
    (`CreatePlatformEventsCustomFields.txt`) available in the
    [FINS Common Resources](https://anypoint.mulesoft.com/exchange/org.mule.examples/fins-common-resources-src/)
    under the `/salesforce` folder.

### Create Apex Triggers

Follow the below steps to create the Apex Triggers

1.  Login to Salesforce.

2.  Click Setup to search for Object Manager in Quick Find Box.

3.  Search for the Salesforce Object. A page appears with Details of the Object.

4.  Click Triggers unders the Details section to see list of available triggers on the Object. Click
    New.

5.  Copy the Trigger Script code searching by Apex Trigger Name (mentioned in the above table for
    the SalesforceObject) in CreateApexTriggers.txt of
    [FINS Common Resources](https://anypoint.mulesoft.com/exchange/org.mule.examples/fins-common-resources-src/)
    to the script editor. CreateApexTriggers.txt file is available under /salesforce folder.

6.  Obtain the `LastModifiedById` and `RecordTypeId` (if it exists) by running the queries mentioned
    in the trigger from Developer Console.

7.  Replace the values in the script and Save the trigger.

8.  Click Save and ensure isActive checkbox is ticked.

9.  Repeat the steps for all the Salesforce objects in the above table.

### Additional Notes

- All the Apex Triggers created above filters records based on
  `LastModifiedBy <> {Service account ID}`. This is to filter out updates done by the Salesforce
  Customers and Salesforce Financial System APIs to avoid cyclical updates. This can be obtained by
  running the query `SELECT Id FROM User WHERE Username='<service-account-username>'` in the
  Developer Console.

- The Apex Triggers AccountEventsPub, and AccountAddressEventsPub also filter records based on
  record type ID. The record type ID can be obtained by running the query
  `SELECT Id,Name FROM RecordType where Name='Household' and sObjectType='Account'` in the Developer
  Console.

- The Apex Trigger HouseholdEventsPub also filter records based on record type ID. The record type
  ID can be obtained by running the query
  `SELECT Id,Name FROM RecordType where Name='Account' and sObjectType='Account'` in the Developer
  Console.

## Adding Mailing Address to Person Account details Page

The following instructions assume that
[support for Person Accounts](https://help.salesforce.com/s/articleView?id=sf.account_person_enable.htm&type=5)
is already enabled. Perform the following actions to enable Mailing Address on the Person Account
detail page.

1.  Click the Salesforce Setup icon.

2.  Select the `Object Manager` tab from the Setup home page.

3.  Search for `Person Account` and select it.

4.  From the menu on the left, click on `Page Layouts` and select the layout you want to adjust.

5.  Click the `Fields` tab on the palette to show all the available fields.

6.  Search for `MailingAddress` and select it.

7.  Drag the field from the palette and drop it in the `Address Information` section of the layout

8.  Click the **Save** button.

## Creating Contacts not Associated with an Account

These instructions assume that the Salesforce FSC instance includes access to the `Contact` object.

1.  Click the Salesforce Setup icon.

2.  Select the `Object Manager` tab from the Setup home page.

3.  Search for `Contact` and select it.

4.  From the menu on the left, click on `Page Layouts` and select the layout you want to adjust.

5.  Find the `Account Name` field on the layout and hover over it. Then, click the wrench icon to
    show the field properties.

6.  Deselect the `Required` checkbox and confirm your changes.

7.  Click the **Save** button.

## Adding Fields to Opportunity Page

Perform the following actions to enable custom fields in Opportunity default page.

1.  Click the Salesforce Setup icon.

2.  Select the `Object Manager` tab from the Setup home page.

3.  Search for `Contact` and select it.

4.  From the menu on the left, click on `Page Layouts` and select the layout you want to adjust.

5.  Click the `Fields` tab on the palette to show all the available fields.

6.  Search for `KYC Completed` and select it.

7.  Drag the field from the palette and drop it in the `Opportunity Information` section of the
    layout.

8.  Repeat the last two steps to add the `Document Signatues Recieved`,
    `Ach Transfer Auth Document Id`, and `Asset Transfer Auth Document Id` fields.

9.  Click the **Save** button.

## Configure Connected App for Authentication

Follow the below steps to generate the `Consumer Key` and `Consumer Secret` values required for
Salesforce authentication.

1.  Click the Salesforce Setup icon.

2.  Navigate to `Apps -> App Manager`.

3.  Select `New Connected App`.

4.  Enter Connected App Name: `MuleSoft Accelerator`, API Name: `MuleSoft_Accelerator` and set your
    email address.

5.  In the `API (Enable OAuth Settings)` section, check the box `Enable OAuth Settings`.

6.  Set the callback URL `http://localhost`.

7.  From the `Selected OAuth Scopes` list, select `Full access (full)`.

8.  Click **Save** and then **Continue**.

9.  Click the **Manage** button to view details for the new connected app.

10. Click the **Edit Policies** button.

11. In the `OAuth Policies` section, for `Permitted Users` select `All users may self-authorize`.

12. For `IP Relaxation`, select the `Relax IP restrictions` option.

13. Click **Save**.

You now need to copy the `Consumer Key` and `Consumer Secret` values for use in configuring Mule
application deployments. More specifically, these must be supplied as the values for the
`sfdc.fsc.client-id` and `sfdc.fsc.client-secret` properties found in the `FSC-BANKING-DEV`,
`FSC-Insurance-DEV` and `FSC-WEALTH-DEV` profiles in your Maven `settings.xml` file.

1.  On the Setup Home page, navigate to `Apps -> App Manager`.

2.  Locate your new connected app and choose `View` from the actions dropdown for that item (last
    column on the right).

3.  Under the `API (Enable OAuth Settings)` section, click the **Manage Consumer Details** button.

4.  Verify your identity by entering the verification code that was emailed to you.

5.  Copy the key and secret values and update your `settings.xml` file as described above.

Download the
[FINS Common Resources project](https://anypoint.mulesoft.com/exchange/org.mule.examples/fins-common-resources-src)
for a sample `settings.xml` file that can be used as a starting point.

## Generating Security Token for Service Account

A token needs to be generated for the service account used by the Mule applications in order to
connect to the FSC instance.

1.  Login to Salesforce as the Service Account User (the account that will be used by the Mule
    applications for connecting to Salesforce).

2.  Click the Username icon in the top right corner and select `Settings` from the menu.

3.  Select `My Personal Information -> Reset My Security Token` (if not found, see note below).

4.  Click **Reset Security Token**.

5.  Check the email inbox for an email from Salesforce with the new security token.

> [!NOTE] If the option to reset your security token is not available, it is likely that one or more
> Login IP Ranges are in effect. These can be temporarily removed from the settings page of the
> profile assigned to the service account user.

## Contact Point Mappings

The following table lists the conditions used to assign ContactPoints in Salesforce:

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>CIM PartyRole - Party</th><th>Salesforce Object - Record Type</th><th>Condition</th><th>Action in Salesforce</th><th>Comments</th></tr></thead><tbody><tr><td><p>Customer - Individual</p></td><td><p>Account - PersonAccount</p></td><td><p>ContactPointAddress with <code>isUsedForBilling</code> set as <code>false</code></p></td><td><p>Assign Address as <code>PersonMailingAddress</code></p></td><td><p>If multiple addresses match this condition, the one with primaryFlag set to true is used; if none set the first one will be used</p></td></tr><tr><td><p>Customer - Individual</p></td><td><p>Account - PersonAccount</p></td><td><p>ContactPointAddress with <code>isUsedForBilling</code> set as <code>true</code></p></td><td><p>Assign Address as <code>BillingAddress</code></p></td><td></td></tr><tr><td><p>Customer - Individual</p></td><td><p>Account - PersonAccount</p></td><td><p>ContactPointPhone with <code>isSMSCapable</code> set as <code>false</code></p></td><td><p>Assign Phone Number as <code>Phone</code></p></td><td><p>If multiple phones match this condition, the one with primaryFlag set to true is used; if none set the first one will be used</p></td></tr><tr><td><p>Customer - Individual</p></td><td><p>Account - PersonAccount</p></td><td><p>ContactPointPhone with <code>isSMSCapable</code> set as <code>true</code></p></td><td><p>Assign Phone Number as <code>PersonMobilePhone</code></p></td><td></td></tr><tr><td><p>Customer - Organization</p></td><td><p>Account - Account</p></td><td><p>ContactPointAddress with <code>isUsedForBilling</code> set as <code>true</code></p></td><td><p>Assign Address as <code>BillingAddress</code></p></td><td><p>If multiple addresses match this condition, the one with primaryFlag set to true is used; if none set the first one will be used</p></td></tr><tr><td><p>Customer - Organization</p></td><td><p>Account - Account</p></td><td><p>ContactPointAddress with <code>isUsedForBilling</code> set as <code>true</code></p></td><td><p>Assign Address as <code>BillingAddress</code></p></td><td><p>If multiple addresses match this condition, the one with primaryFlag set to true is used; if none set the first one will be used</p></td></tr><tr><td><p>Customer - Organization</p></td><td><p>Account - Account</p></td><td><p>ContactPointAddress with <code>isUsedFoShipping</code> set as <code>true</code></p></td><td><p>Assign Address as <code>ShippingAddress</code></p></td><td></td></tr><tr><td><p>Customer - Organization</p></td><td><p>Account - Account</p></td><td><p>ContactPointPhone with <code>isFaxCapable</code> set as <code>false</code></p></td><td><p>Assign Phone Number as <code>Phone</code></p></td><td><p>If multiple phones match this condition, the one with primaryFlag set to true is used; if none set the first one will be used</p></td></tr><tr><td><p>Customer - Organization</p></td><td><p>Account - Account</p></td><td><p>ContactPointPhone with <code>isFaxCapable</code> set as <code>true</code></p></td><td><p>Assign Phone Number as <code>Fax</code></p></td><td></td></tr></tbody></table>

\*The default value for all flags is `false`.

## Creating Stop Check and Stop ACH Buttons

To enable Stop Check and Stop Automated Clearing House (ACH) features, you must create a button for
both features in your Salesforce org. Follow these steps to create the buttons:

1.  Set up
    [named credentials](https://help.salesforce.com/s/articleView?id=sf.nc_named_creds_and_ext_creds.htm&type=5)
    for making HTTP calls to Mule APIs.

2.  Deploy the Stop Check and Stop ACH flows from the package provided in
    [FINS Common Resources](https://anypoint.mulesoft.com/exchange/org.mule.examples/fins-common-resources-src/).
    See
    [Flow Builder](https://help.salesforce.com/s/articleView?id=sf.flow.htm&language=en_US&type=5)
    in Salesforce Help for information about creating flows.

3.  Add **Stop Check** and **Stop ACH** buttons to the Financial Account object in your Salesforce
    org. See
    [Customize Standard and Custom Buttons on Page Layouts](https://help.salesforce.com/s/articleView?id=sf.customizing_detail_page_buttons.htm&type=5)
    in Salesforce Help for information about creating buttons.

4.  Create a quick action for each button to enable users to access the buttons easily. See
    [Create a Quick Action for a Flow](https://help.salesforce.com/s/articleView?id=sf.fsc_slack_app_create_a_quick_action_for_a_flow.htm&type=)
    for information about creating quick actions.

## See Also

- [Prerequisites](https://docs.mulesoft.com/financial-services/latest/prerequisites)

- [MuleSoft Accelerator for Financial Services](https://docs.mulesoft.com/financial-services/latest/)
