Salesforce: Install/Configuration Guide v1.1

Capital Preferences Salesforce App – Installation & Configuration Guide

 

Welcome to Capital Preferences Salesforce Integration.
Follow the steps below to configure your environment and begin using the Revealed Preferences app within Salesforce.

1. Components Installed

This package includes:

·       Connected App: Revealed Preferences (Canvas App integration)

·       Visualforce Page: CP_RevealedPreferencesOverview (for Lightning embedding)

·       Lightning App Page: Capital Preferences Settings

·       Custom Metadata Type: Config__mdt (secured via package scope)

·       Permission Set: Capital Preferences Admin

·       Custom Objects: For storing inbound webhook events

·       Internal Apex Classes: For lifecycle handling and secure metadata access (no user action required)

 

2. Assign Permission Sets

Permission Set Packaged? Grants Assign to
Capital Preferences Admin Yes
  • Customize Application
  • Manage Custom Metadata Types
  • Access to Capital Preferences Settings page
Org admins who configure / maintain the integration
Capital Preferences User Yes
  • Visualforce Page Access → CP_Revealed_Preferences_Overview
  • Apex Class Access → CPCanvasAppLifecycleHandler

2.1 Create a Data-Access permission set

Because master-detail packaging rules prevent us from shipping object CRUD/FLS in Capital Preferences User, create one local permission set (suggested name Capital Preferences Data Access or Capital Preferences API User) and:

1. Grant CRUD access for the below objects in Object Settings

·       Account

·       cprps__EFP__c

·       cprps__Risk_Preference__c

·       cprps__Values_Preference__c

2. Enable API Access by going to System Permissions and check API Enabled

Assign both Capital Preferences User and Capital Preferences Data Access to:

·       All end-users who must see the canvas and view webhook data.

·       The Integration User if you enable the Client-Credentials flow.

Assignment steps

1.          Setup Users Permission Sets

2.          Open the desired set → Manage Assignments Add Assignments

3.          Tick the users (or the integration user) → Save

 

3. Configure Connected App
The Revealed Preferences connected app is installed and preconfigured with the required scopes and settings.
To complete setup, you must configure
one of the supported authentication methods below.

Option 1: Refresh Token (Recommended for simplicity)

1.          Go to Setup → App Manager → Revealed Preferences → Manage.

2.          Under OAuth Policies, set:

o   Refresh Token Policy: Refresh token is valid until revoked

3.          Ensure Admin approved users are pre-authorized is enabled.

This option allows Capital Preferences to securely push data using the stored refresh token provided when the app is first launched.

Option 2: Client Credentials Flow

1.          In the same Connected App settings, enable:

o   Client Credentials Flow

2.          Under Client Credentials Flow → Run As, select a Salesforce user with appropriate object permissions.

3.          Ensure Admin approved users are pre-authorized is enabled.

This option avoids long-lived refresh tokens by allowing your system to authenticate via client ID/secret.
Be sure the selected user has access to all relevant custom objects and Apex functionality in the package.

4. Set Up Capital Preferences Settings
The user configuring Capital Preferences Settings must have Customize Application and Manage Custom Metadata Types (or Modify All Data) on their profile or via a permission set.

From the App Launcher, open 'Capital Preferences Settings':

1. Enter the API Key provided by Capital Preferences

2. (Optional) Choose the Region

3. Click Save

Note: This configuration is stored in a Custom Metadata Type with package scope. Direct edits in Setup are restricted for security. Use this Settings page only.

 

5. Embed the App in Account Page

You can embed the Revealed Preferences app directly into any Account record page for easy access.

Recommended Setup

Create a dedicated tab on the Account page to host the app:

1.          Navigate to any Account record

2.          Click the ⚙️ gear icon → Edit Page

3.          In the Lightning App Builder:

o   Select the Tabs component on the canvas

o   Click Add Tab, choose Custom, and label it "Revealed Preferences"

o   Drag a Visualforce Page component into the new tab

o   In the right panel:

§  Set Visualforce Page to: CP_RevealedPreferencesOverview

§  Adjust height to 900px (recommended)

§  Set show label to false

4.          Click Save, then Activate the page if prompted

This setup ensures users can access the app contextually while viewing any Account.

💡 Alternate Layouts

You may embed the app in a different location on the page (e.g., in the Details tab or a custom section) depending on your organization's workflow preferences.

 

6. Troubleshooting Tips

Issue Fix
Canvas app not loading Check if API key is configured in the Settings page
Access denied errors Ensure "Admin approved users" is enabled and a permission set is assigned
Data not syncing from CP Verify refresh token or client credentials are configured properly

 

Support

For technical issues or to request an API key, contact: support@capitalpreferences.com

 

You're all set!

Thanks for installing Capital Preferences! You’re now ready to integrate revealed preferences insights directly within Salesforce.